1

/scoreboard players tag is a new feature for Minecraft 1.9, and so obviously this question doesn't pertain to the current release of 1.8, and answers should reflect that

Say I put the following command, which is used as an example in the 15w32b wiki article, in a repeating command block and set it to run:

/scoreboard players tag @a add InAir {OnGround:0b}

Anyone who is not on the ground will get the InAir tag, but will the tag automatically be removed when they hit the ground? If the tag is not removed automatically, how do I remove them? The linked article doesn't seem to provide a way.

1

No, the tag won't be removed automatically. You can test this yourself by placing the following command in your command block chain:

/tell @p[tag=InAir] Jumping

After jumping the first time, you will continuously receive the "Jumping" message, even after you return to the ground.

What you need to do, similar to what you've done in the past with scoreboard objectives used in boolean tests, is clear the tags of everyone before reapplying them to those you want tagged. In your example, you'd use the following command:

/scoreboard players tag @a remove InAir

which is the obvious counterpart to the the add version of the command, but that's not stated in the wiki.

I should note that I haven't tested to see if the remove version also accepts the data tag, but I suspect it does. That would allow for some interesting logic.

  • Yes, the remove version does accept the data tag, so you can use /scor...ag @a remove InAir {OnGround:1b}. – wizzwizz4 Dec 7 '16 at 18:32
0

Just add this command: /scoreboard players tag @a remove InAir {OnGround:1b}

This command will remove the tag from anyone who is one the ground {OnGround:1b}

Obviously, You should make sure the command blocks are set to always-active and repeating on both commands: Mine and Yours

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.