1
[Solved] 1.9 Command for testing held item not working
/scoreboard players set @a spawnerPick 1 {SelectedItem:{id:golden_pickaxe,tag:{ench:[id:33,lvl:1]}}}
Does not find me, despite my holding a gold pick with sick touch.
Create an account or sign in to comment.
10
1
maybe add Count:1 between id and tag keys
1
I actually think I may have dealt with something like this before. If I remember correctly, the problem was that there was a second data tag on the tool that for some reason was required in the testfor (it was RepairCost if I remember correctly). It was only on the item because it was obtained with an anvil, rather than with a command.
Try this: hold f3 and hit the 'h' button. This should bring up more data about the items when you hover your mouse over it in your inventory. If it says there is only 1 tag, then I don't really know what's wrong. If it says two, then you've probably got the extra tag. If this is the case, I'd suggest going into mcedit and looking at the data structure of the item. Whatever tag you're missing, put it in.
Try this: hold f3 and hit the 'h' button. This should bring up more data about the items when you hover your mouse over it in your inventory. If it says there is only 1 tag, then I don't really know what's wrong. If it says two, then you've probably got the extra tag. If this is the case, I'd suggest going into mcedit and looking at the data structure of the item. Whatever tag you're missing, put it in.
1
That was it, apparently. Very odd. Well, thank you for your help!
1
It might be worth adding, if I take out
,tag:{ench:[{id:33,lvl:1}]}
entirely, it does work, but when I add it back it doesn't. Also, I've tried taking ench: out of tag: but that doesn't help.1
SquidMannnMake it as ench:[{}] instead of ench:[] if that doesnt work use ench:{}
I tried every possible combination of brackets at ench but nothing changed.
1
Make it as ench:[{}] instead of ench:[] if that doesnt work use ench:{}
1
Typically I put quotes around item names, as well as the minecraft: prefix. I'm not sure if that matters or not, but for some reason I've always done that. Also, remember that each enchantment in the list needs it's own set of brackets {}, even if there is only 1.
Try out this code, see if it works:
Try out this code, see if it works:
/scoreboard players set @a spawnerPick 1 {SelectedItem:{id:"minecraft:golden_pickaxe",tag:{ench:[{id:33,lvl:1}]}}}
1
I updated my code to be that, but it still doesn't work, same error.
1
What output in the command block are you getting?
1
Sorry, I didn't put it in because I didn't think it was necessary.
It's singleplayer, but for a sever if that means anything.
[20:15:38] The dataTag does not match for Lunar_Octave
It's singleplayer, but for a sever if that means anything.