0

How can I test for a player with scoreboard holding a skull with damage 2s in his active slot with a name? I tried SelectedItem instead of Inventory, but it didn't work. I do it in 1.9. Here is a command:

/testfor @a[score_Medusashead_min=1,score_Medusashead=1] {SelectedItem:[{id:minecraft:skull,Damage:2s,tag:{display:{Name:"Medusa's head"}}Count:1b}]}
1

First of all, SelectedItem's value is an object, not an array. That means that you should remove the square brackets around the SelectedItem tag's value. The next thing to do is to add a comma before Count:1b. Your final command should then be:

/testfor @a[score_Medusashead_min=1,score_Medusashead=1] {SelectedItem:{id:minecraft:skull,Damage:2s,tag:{display:{Name:"Medusa's head"}},Count:1b}}
| improve this answer | |
  • Thank you. I used the SelectedItemSlot thing, so it is now solved. But thanks anyway. – Super Dirt May 17 '16 at 7:04
  • Ok, no problem. – Jacques Marais May 30 '16 at 19:06

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.