1

I am using two commands via command block:-

scoreboard teams join No-PVP @p[3743,70,3954,32,team=!No-PVP]
scoreboard teams join PVP @p[3743,70,3954,100,rm=36,team=!PVP]

Now, these commands work fine when you enter and leave the radius specified... but when you're inside the radius and teleport away from it, you don't seem to leave the team. It looks as if the command block isn't seeing that I have moved. What is causing this and how can I fix it?

  • How far from the command blocks are you teleporting? If the command blocks are not in a spawn chunk (which always stay loaded) then moving out of the loaded chunk range will cause everything in the too-distant chunks to be unloaded (including command blocks). – Shadowtrot Jul 5 '15 at 2:20
  • You seem to have people join no-PVP when they are within 32 blocks of your coordinates, and PVP is they are more than 36 but less than 100 blocks away. Is that what you want? If so, what exactly doesn't work? – MrLemon Jul 15 '15 at 9:28
1

The issue lies with the second command:

scoreboard teams join PVP @p[3743,70,3954,100,rm=36,team=!PVP]

Using 4 arguments without their keywords makes the game read them as x, y, z, and r. Your players are only assigned to the PVP team when they are between 36 and 100 blocks away from the specified coordinates. If they teleport farther away, the command does not apply to them.

The solution is to simply remove 100, from the command to disable the upper limit.

-1

If you're using a spigot server or such modifications care about the fact spawn chunks can be not kept loaded if you don't use a plugin for it like ChunkLoader.

  • A workaround would be to use a cage where to teleport players to change their team. After that you teleport them away. (use a fill clock to minimize the time past in the cage) – bZx Jul 15 '15 at 1:25
  • This does not provide an answer to the question. If you wish to request clarification on a post, leave a comment. You can always comment on your own posts, and will be able to comment on all posts one you have a little reputation. – MrLemon Jul 15 '15 at 9:21

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.