How can I make the compass point to a player?

How can I make the compass point to a player? - Person Holding Can With Blue and White Knit Sweater

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

First, a quick note: this command does NOT WORK IN JAVA EDITION. As of 2020, the best way to do this is with a repeating command block set to always active and with this command set in it: /execute [insert prey gamertag] ~ ~ ~ setworldspawn ~ ~ ~. This will work, but you need to do 2 quick things in order for it to work 100% of the time. First, give the command /gamerule commandblockoutput false so that chat isn't constantly filled saying the spawnpoint was changed. Second, you need to set a ticking area around the command block. You'll need the coordinates for this. You need to use /tickingarea add [insert coordinates] [insert coordinates]. The ticking area must be the 3x3 area around the command block, with the command block in the center. Now just make sure the hunter has a large supply of compasses and set their personal spawnpoint near the command block to prevent them from respawning on top of you. Enjoy!




Pictures about "How can I make the compass point to a player?"

How can I make the compass point to a player? - Close-Up Photograph of a Can
How can I make the compass point to a player? - 

Women Holding Canned Beverages while Pointing
How can I make the compass point to a player? - Yellow Haired Woman in Brown Hat Illustration



How do you make a compass point to a player in Minecraft?

So, let's get started!
  • Place the Lodestone. First, go to the dimension that you want the Lodestone Compass to work in (Overworld, Nether, or End) and place the Lodestone block. ...
  • Select the Compass in the hot bar. ...
  • Use the Compass on the Lodestone. ...
  • Lodestone Compass will point to the Lodestone.




  • How to make Compass point towards Player in Minecraft (Dream Manhunt) - Tutorial




    More answers regarding how can I make the compass point to a player?

    Answer 2

    I solved all my problems with "/execute" there was an "@" after I think it was this . Basically I used a tag named Runner and made the world spawn wherever they were with a repeating_command_block it the command was something like this:

    /execute @(/tag=Runner) setworldspawn ~ ~ ~. 
    

    I hope this helps any one with a problem setting up an assassin vs speed runner world.

    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Anna Shvets, Tima Miroshnichenko, Styves Exantus, Alexander Sergienko