6

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.

  • 3
    Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins! – Frank Mar 4 '16 at 12:54
  • 3
    uhm... i have: set new spawnpoint repeatedly. and i see this comment of you like for 1 billion times! I know that it is better not to rely on others, you should try your way out first but the thing is I HAVE TRIED MY BEST IT TOOK ME 3 DAYS THINKING AND TESTING!!!! – Cụ Rùa Mar 4 '16 at 13:34
  • 3
    @Frank he did try something, even though he did not post the commands he used. I assume it was something like running /execute @a[team=hunted] ~ ~ ~ /spawnpoint @a[team=hunter] ~ ~ ~ – MrLemon Mar 4 '16 at 13:45
  • 1
    Wow... Exactly. I connect it to a fast redstone clock,so that the hunted's location could be updated. But, as I have mentioned before, the compass only updates when the hunters respawn. – Cụ Rùa Mar 4 '16 at 13:54
  • 1
    Adding in what you have tried is important. Otherwise, we might be retreading the same ground you've already gone over. – Frank Mar 4 '16 at 13:54
3

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.

| improve this answer | |
  • 1
    @ash4fun I think you should use @a instead of @p – RudolfJelin May 21 '16 at 17:37
  • 1
    @RudolfJelínek There can only be one worldspawn, so it doesn't make sense to set it to more than one person. @r should work though. – ash4fun May 23 '16 at 20:35
  • 1
    @ash4fun I just said that because there were problems with @p[something] in older MC versions :D – RudolfJelin May 24 '16 at 13:24
  • 1
    @RudolfJelínek Problems in older versions are irrelevant because /execute was introduced in 1.8 and there are no "issues" with @p. – Skylinerw May 24 '16 at 13:51
  • 1
    @Skylinerw I'll remember that for further answers – RudolfJelin May 24 '16 at 16:42
1

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!

| improve this answer | |
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.