Testfor an item in player's hand
//ads -- adsterra.com -- native banner
?>
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}]}
Best Answer
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}}
Pictures about "Testfor an item in player's hand"



Minecraft Bedrock - Test For Items In Inventory (Mobile/Xbox/PS4/Windows 10/Switch)
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Rachel Claire, Karolina Grabowska, Disha Sheta, Erik Mclean
