Minecraft – How to make the compass point to a player

minecraft-commandsminecraft-java-edition

I want to make a hunting Minecraft map, and each hunter has a tracking compass that points to the nearest player. My friend said that I need a plugin or mod (I don't know what a plugin is!). The plugin thing seems to be complicated so I want to know if there's a way to do this with commands only.

I tried setting spawnpoints of the hunters to the hunted but this only works if the hunter dies: next time they respawn, the compass points to it but only where the hunted stood when the hunter died.

Best Answer

I checked, and /setworldspawn does change the compass immediately. Try running on a clock:

/execute @p[team=hunted] ~ ~ ~ setworldspawn ~ ~ ~

if you encounter any problems, please leave a comment and I will look into it.

Related Topic