0

Im working on a Minecraft map similar to a 3d Mario game. I am currently struggling on enemy AI and would like some help. I want to make it so when you are within the 16 blocks of a zombie, they act and move normally, but if you aren't within their range they receive slowness making them unable to move. If it is possible I would like to make it so every zombie has its own system (example: if I was by a zombie, only that one would unfreeze, every other zombie would still be frozen.

Thanks everyone!

1 Answer 1

0

Keep running these two commands in repeating command blocks:

/execute @a ~ ~ ~ effect @e[type=zombie,rm=16] slowness 1 255 true

/execute @a ~ ~ ~ effect @e[type=zombie,r=16] slowness 

This solution works for one player only. Need a solution for multiplayer? Comment below.

2
  • How would one for multiplayer work? Jul 30, 2020 at 4:44
  • 2
    @DonnieKnight Multiplayer is a bit trickier. The first command wouldn't work, so we'd need to set up something that makes the zombies check for players nearby. I'll update this post by editing it. Be sure to follow this answer to receive notifications when this is updated.
    – One 2 Many
    Jul 30, 2020 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .