I'm trying to have a command block check a player's inventory to see if they have a particular item. I cannot figure out a command to do it. Does anyone know a command for this and how to use it?
The best u can do is attempt to clear that item from their inventory, if it is there the command block will succeed thus producing an output from a comparator allowing u to activate whatever else u need + give them the item back if need be
I dont know of a command that does that, but it shouldn't be too hard to code one. Just scan through the inventory container and see if your typed arguments match an item id.
First command block clears the item and emits a signal, second one gives them the item back, I set up a lock so that when you get the item, it doesnt instantly clear it again until you reset it. The third command block will do whatever you want. If you want to tp them, use /tp, or you can remove the command block and use the output to power a note block, door, or logic gate. When you power the torch that is powering the piston for the reset, it unpowers the piston and restarts the update clock, starting the clear, and give commands again!
First command block clears the item and emits a signal, second one gives them the item back, I set up a lock so that when you get the item, it doesnt instantly clear it again until you reset it. The third command block will do whatever you want. If you want to tp them, use /tp, or you can remove the command block and use the output to power a note block, door, or logic gate. When you power the torch that is powering the piston for the reset, it unpowers the piston and restarts the update clock, starting the clear, and give commands again!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Thanks,
JMEL2012
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
First command block clears the item and emits a signal, second one gives them the item back, I set up a lock so that when you get the item, it doesnt instantly clear it again until you reset it. The third command block will do whatever you want. If you want to tp them, use /tp, or you can remove the command block and use the output to power a note block, door, or logic gate. When you power the torch that is powering the piston for the reset, it unpowers the piston and restarts the update clock, starting the clear, and give commands again!
First command block clears the item and emits a signal, second one gives them the item back, I set up a lock so that when you get the item, it doesnt instantly clear it again until you reset it. The third command block will do whatever you want. If you want to tp them, use /tp, or you can remove the command block and use the output to power a note block, door, or logic gate. When you power the torch that is powering the piston for the reset, it unpowers the piston and restarts the update clock, starting the clear, and give commands again!