I've been trying to 2 hours to get this stupid command to work. My tolerance has ran out and I'm asking for help! See I'm trying to set a score of 1 for players wearing a set of dyed leather boots that's name TEST. the scoreboard is here below.
/scoreboard players set @a[score_inAir=0] inAir 1 {OnGround:0b,ArmorItems:[{Slot:100b,id:"minecraft:leather_boots",Count:1b,tag:{ench:[{:"lvl:0",id:99}],Unbreakable:1b,display:{color:3291997,Name:"TEST"}},Damage:0s},{},{},{}]}
This detects whether or not he's in the air and wearing the boots. But it says the tags doesn't exist on the player. HELP!
The command for setting it to zero when he hits the ground is also having the same problem:
/scoreboard players set @a[score_inAir_min=1] inAir 0
{OnGround:1b,ArmorItems:[{Slot:100b,id:"minecraft:leather_boots",Count:1b,tag:{ench:[{:"lvl:0",id:99}],Unbreakable:1b,display:{color:3291997,Name:"TEST"}},Damage:0s},{},{},{}]}
OK, there is 1-3 things wrong with your command, the first thing that may or may not be wrong with it is that the boots you have are not the specified ones. that may not be the case but if it is this command will get you the right boots based on the /scoreboard command you have here:
The next thing that may or may not be wrong is you might not have it connected to a redstone clock, you could either make a fill clock or if your using the new 1.9 snapshots (which i guess you are using based on the ArmorItems tag in your above command) you could use a powered blue repeating command block.
Now the next part is what is defiantly wrong with your command, so I will show your command with the incorrect parts bolded and then explain why its wrong, and the unneededparts striked through
/scoreboard players set @a[score_inAir=0] inAir 1 {OnGround:0b,ArmorItems:[{Slot:100b,id:"minecraft:leather_boots",Count:1b,tag:{ench:[{:"lvl:0",id:99}],Unbreakable:1b,display:{color:3291997,Name:"TEST"}},Damage:0s},{},{},{}]}
[score_inAir=0] - don't need this because if the players score is already "1" it won't change anything with that specified.
OnGround:0b, - unneeded unless you need the player to be on the ground to have the score
ArmorItems - Incorrect because, even though you may be using the new snapshot, ArmorItems is used for entities not players, the tag you would use would be Inventory:[]
"lvl:0" - and easy fix, just get rid of the quotation marks ("")
Unbreakable:1b - just get rid of this, I'm not sure if this is even a tag...
[score_inAir=0] - don't need this because if the players score is already "1" it won't change anything with that specified.
Specifying "inAir=0" will prevent the command from constantly firing if the player matches. Without it, the command will still execute completely when activated, even when their score is already 1.
Ok, after reading all your comments, I got the command to function after lots of typing and retyping. (Just some minor things that you suggested I tweaked tho)
EDIT:
Now how do I detect if the Player does NOT have an item in the slot?
Sadly I don't think that is possible, and if it was I would also like to know how to. but what I usually do is have a comparator that powers a NOT gate (a redstone gate that turns of when powered and on when unpowered)
For a multiplayer-friendly version, you'd have to set their score as if they did not have the boots first and then set their score to something different if they actually did.
1. Set their score to 0, indicating they did not have the item.
/scoreboard players set @a HasItem 0
2. Set their score to 1 if they actually did.
/scoreboard players set @a HasItem 1 {Inventory:[{id:"minecraft:stone"}]}
After that point, players that did not have the item will not have their "HasItem" score changed to 1, so they will remain at a score of 0. All other commands would run after this point.
For a multiplayer-friendly version, you'd have to set their score as if they did not have the boots first and then set their score to something different if they actually did.
1. Set their score to 0, indicating they did not have the item.
/scoreboard players set @a HasItem 0
2. Set their score to 1 if they actually did.
/scoreboard players set @a HasItem 1 {Inventory:[{id:"minecraft:stone"}]}
After that point, players that did not have the item will not have their "HasItem" score changed to 1, so they will remain at a score of 0. All other commands would run after this point.
Thanks Liner. i went and optimized the thing to include the score and it tested greatly. It's just a bit problematic that it flicks between 0-1 really quicky which actually is causing problems but I found out how to prevent that.
This makes it so that the score is locked at 1 during while I'm holding the item, but prevents the 0-1 flicker from happening since I'm testing for a score of at least 0. If they don't the score is removed and is set to -1. So I typically use a 2 point window rather than a 1 point window.
I've been trying to 2 hours to get this stupid command to work. My tolerance has ran out and I'm asking for help! See I'm trying to set a score of 1 for players wearing a set of dyed leather boots that's name TEST. the scoreboard is here below.
/scoreboard players set @a[score_inAir=0] inAir 1 {OnGround:0b,ArmorItems:[{Slot:100b,id:"minecraft:leather_boots",Count:1b,tag:{ench:[{:"lvl:0",id:99}],Unbreakable:1b,display:{color:3291997,Name:"TEST"}},Damage:0s},{},{},{}]}
This detects whether or not he's in the air and wearing the boots. But it says the tags doesn't exist on the player. HELP!
The command for setting it to zero when he hits the ground is also having the same problem:
/scoreboard players set @a[score_inAir_min=1] inAir 0
{OnGround:1b,ArmorItems:[{Slot:100b,id:"minecraft:leather_boots",Count:1b,tag:{ench:[{:"lvl:0",id:99}],Unbreakable:1b,display:{color:3291997,Name:"TEST"}},Damage:0s},{},{},{}]}
Mewtwo is the best pokemon!
If you don't want to learn what you may have done wrong, just use the first command below, it should work:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OK, there is 1-3 things wrong with your command, the first thing that may or may not be wrong with it is that the boots you have are not the specified ones. that may not be the case but if it is this command will get you the right boots based on the /scoreboard command you have here:
The next thing that may or may not be wrong is you might not have it connected to a redstone clock, you could either make a fill clock or if your using the new 1.9 snapshots (which i guess you are using based on the ArmorItems tag in your above command) you could use a powered blue repeating command block.
Now the next part is what is defiantly wrong with your command, so I will show your command with the incorrect parts bolded and then explain why its wrong, and the
unneededparts striked through[score_inAir=0] - don't need this because if the players score is already "1" it won't change anything with that specified.
OnGround:0b, - unneeded unless you need the player to be on the ground to have the score
ArmorItems - Incorrect because, even though you may be using the new snapshot, ArmorItems is used for entities not players, the tag you would use would be Inventory:[]
"lvl:0" - and easy fix, just get rid of the quotation marks ("")
Unbreakable:1b - just get rid of this, I'm not sure if this is even a tag...
and there you go you should be set to go
Hope this helped
Specifying "inAir=0" will prevent the command from constantly firing if the player matches. Without it, the command will still execute completely when activated, even when their score is already 1.
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/
Ok, after reading all your comments, I got the command to function after lots of typing and retyping. (Just some minor things that you suggested I tweaked tho)
EDIT:
Now how do I detect if the Player does NOT have an item in the slot?
Mewtwo is the best pokemon!
Sadly I don't think that is possible, and if it was I would also like to know how to. but what I usually do is have a comparator that powers a NOT gate (a redstone gate that turns of when powered and on when unpowered)
example of NOT gate:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
example of my mechanism:
once again: hope this helps
Yes, that's what I did, thx man!
Mewtwo is the best pokemon!
For a multiplayer-friendly version, you'd have to set their score as if they did not have the boots first and then set their score to something different if they actually did.
1. Set their score to 0, indicating they did not have the item.
2. Set their score to 1 if they actually did.
After that point, players that did not have the item will not have their "HasItem" score changed to 1, so they will remain at a score of 0. All other commands would run after this point.
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/
Thanks Liner. i went and optimized the thing to include the score and it tested greatly. It's just a bit problematic that it flicks between 0-1 really quicky which actually is causing problems but I found out how to prevent that.
I bypassed that by using
1./scoreboard players add @a HasItem 0
2./scoreboard players remove @a[score_HasItem_min=0] HasItem 1
3./scoreboard players set @a HasItem 1 {Inventory:[{id:"minecraft:stone"}]}
4./execute @a[score_HasItem_min=0] ~ ~ ~ say @p SUCCESS
This makes it so that the score is locked at 1 during while I'm holding the item, but prevents the 0-1 flicker from happening since I'm testing for a score of at least 0. If they don't the score is removed and is set to -1. So I typically use a 2 point window rather than a 1 point window.
Mewtwo is the best pokemon!