Hey! I want to testfor players who have nothing on their selected slot and give them an emptyHand score of 1. But when they do have an item in their hand it will return to 0. So far I have "/scoreboard players set @a emptyHand 1 {idk what to put here :D}"
I'm wondering what dataTags to use to do this. And also how would I set it back to 0 when there is something in the players hand?
Thanks in advance!
Players will not have the "SelectedItem" tag applied if they are not holding an item in their hands. You'll need to set their score to 1 first, and then set it to 0 if the "SelectedItem" tag exists for them:
/scoreboard players set @a emptyHand 1
/scoreboard players set @a emptyHand 0 {SelectedItem:{}}
In this case, their score will only be set to 0 if they are holding an item.
Thank you so much!! Works like a charm.
By the way, thank you so much for all your help in the Minecraft community. I always see your posts on here when I google Minecraft questions and it's a pleasure to have you answer one of mine. (:
I'm wondering what dataTags to use to do this. And also how would I set it back to 0 when there is something in the players hand?
Thanks in advance!
In this case, their score will only be set to 0 if they are holding an item.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
By the way, thank you so much for all your help in the Minecraft community. I always see your posts on here when I google Minecraft questions and it's a pleasure to have you answer one of mine. (:
We are all so grateful for your contributions!
Check out innovative redstone and command block concepts with The Redstone Scientist!