1
Test if player is carrying nothing
So I'm making a command block mechanism, but I need to test if the player is carrying something other than a specified item like testfor @p {SelectedItem:{id:minecraft:stick}}, whereas this instance it'd activate if the player is carrying anything but a stick. If that is impossible is there a way to test if the player is not carrying anything at all?
Create an account or sign in to comment.
3
1
wow that was the biggest facepalm of my life thanks for responses
1
If you run the command you currently have on a fill clock, a comparator will output a signal whenever the player is holding a stick. To see when a player is not holding the stick, simply invert the output of the comparator. The torch will then go off when a player holds the stick, and back on when they select something else.
1
That same command, but invert the signal for anything but a stick. Maybe if you make one of those for every single item, it would work? I'm not the best redstoner in the world, but I think that might work.