effect give @e[type=minecraft:zombie,distance=..8] minecraft:slowness 2 255 true
@s = self · @p = nearest player · @a = all players · @e = all entities
-Intermediate · 1 block
Use a Repeat Command Block to keep applying high-level Slowness to zombies within 8 blocks, making the example mob stop walking.
What you need
Expected result
Zombies within 8 blocks of the Command Block repeatedly receive very high Slowness every second and can barely move away from their spot.
Editable values
Change coordinates, text, range, or amounts; the commands below are regenerated by the real generator.
Configure one block at a time
The copy button copies only Command Input. Choose every other value in the Command Block screen.
Set the Repeat Block to Always Active with Delay in Ticks set to 20, refreshing the effect once per second without running more often than needed.
effect give @e[type=minecraft:zombie,distance=..8] minecraft:slowness 2 255 true
@s = self · @p = nearest player · @a = all players · @e = all entities
-If it does not work