1
Testfor Command help!
Can anyone help me with this?
Im trying to get a command block to test for a specific item in a players inventory (where ever it is). And if this play has that item, more red stone will activate.
Is this even possible?
Could someone help me out with this please!
Thanks
Pheonix
Im trying to get a command block to test for a specific item in a players inventory (where ever it is). And if this play has that item, more red stone will activate.
Is this even possible?
Could someone help me out with this please!
Thanks
Pheonix
Create an account or sign in to comment.
8
1
Thanks for all the help guys!
Figured it out!
Figured it out!
1
Actually, with the new snapshot, they implemented a function just for that! It's a new function for the command /execute (no idea if you are familiar with it but I think you need to have a little bit of knowledge to understand it).
You can check sethbling's video on the new snapshot here (start at 2:40): https://www.youtube.com/watch?v=AZUXfLFMHZo&list=UU8aG3LDTDwNR1UQhSn9uVrw
Hope I helped!
You can check sethbling's video on the new snapshot here (start at 2:40): https://www.youtube.com/watch?v=AZUXfLFMHZo&list=UU8aG3LDTDwNR1UQhSn9uVrw
Hope I helped!
1
You could run
/setblock (coords of comparator) unpowered_comparator 0 destroy
Which will be like resetting the comparator
/setblock (coords of comparator) unpowered_comparator 0 destroy
Which will be like resetting the comparator
1
Unfortunately the way the Testfor command works is by checking if a set rule you give is true and then sending a redstone signal (via comparator) so the command block would need a constant redstone pulse to refresh the command.
The moment the rule becomes untrue the command block will remove the redstone signal. So in your case the moment you move the item to another inventory slot
The moment the rule becomes untrue the command block will remove the redstone signal. So in your case the moment you move the item to another inventory slot
1
Thanks for the help guys.
It worked, but when ever i would hit the button to activate the command block. The comparator on the other side would stay on. Removing the ability to hit the button again.
Any help?
It worked, but when ever i would hit the button to activate the command block. The comparator on the other side would stay on. Removing the ability to hit the button again.
Any help?
1
The easiest way to do this is to add a second command block with the command
Just make x y z the coords of the first command block, and you should be good to go.
blockdata x y z {SuccessCount:0}
Just make x y z the coords of the first command block, and you should be good to go.
1
In the snapshots you can use:
/testfor @a {Inventory:[{Slot:,id:}],SelectedItemSlot:}
put this in a command block and attach a comparator
/testfor @a {Inventory:[{Slot:,id:}],SelectedItemSlot:}
put this in a command block and attach a comparator
1
/clear @p stone 0 0
Will testfor stone
Put that in a command blcok and attach a comparator