I am making an AFK machine where people go stand when they want to be AFK in vanilla Minecraft. So I am trying to detect players that is still in the AFK team (@a[team=AFK]) but not in the place where you stand to be AFK. I then want to remove them from the AFK team.

The AFK "place" (where you stand to be AFK) is cubic. Is it possible to detect players not in this 3x3x2 cubic place rather than within a radius?

  • For future reference, there is no need to put the game name in the title, that's what the tags are for (in fact, one of the tags is displayed in the window title as well). Also, minecraft-redstone is typically used for redstone contraptions rather than command block solutions, even if the latter use a tiny bit of redstone. Tags attract the corresponding experts, and you want the command experts here, not people capable of building 5x5 piston doors. – MrLemon Jun 27 '15 at 21:46

Use the dX, dY, dZ selectors


/scoreboard objectives add inAFK


/scoreboard players set @a inAFK 0
/scoreboard players set @a[x=<X>,y=<Y>,z=<Z>,dX=<X length>,dY=<Y length>,dZ=<Z length>] inAFK 1
/scoreboard players join <Team Name> @a[score_inAFK_min=1]
/scoreboard players leave <Team Name> @a[score_inAKF=0]
| improve this answer | |
  • How will I detect when they leave AFK? – Jacques Marais Jun 27 '15 at 22:21
  • Is it possible to do this but not spam the chat when using tellraw for the players in the AFK team? – Jacques Marais Jun 28 '15 at 11:57

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.