1

Testfor Command help!

Pheonix_Flare 6/25/14 12:27 pm
502
6/25/2014 11:31 pm
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
Posted by
Pheonix_Flare
Level 1 : New Crafter
0

  Have something to say?

JoinSign in

8

Pheonix_Flare
06/25/2014 11:31 pm
Level 1 : New Crafter
Thanks for all the help guys!

Figured it out!
1
TheRedSkorpion
06/25/2014 11:16 pm
Level 20 : Expert System
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!
1
Imadbush
06/25/2014 2:22 pm
Level 21 : Expert Network
You could run
/setblock (coords of comparator) unpowered_comparator 0 destroy
Which will be like resetting the comparator
1
CreativityKing
06/25/2014 1:56 pm
Level 1 : New Miner
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
1
Pheonix_Flare
06/25/2014 1:39 pm
Level 1 : New Crafter
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?
1
Jmal116
06/25/2014 6:59 pm
Level 34 : Artisan System
The easiest way to do this is to add a second command block with the command 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
kolokkol
06/25/2014 1:30 pm
Level 27 : Expert System
In the snapshots you can use:
/testfor @a {Inventory:[{Slot:,id:}],SelectedItemSlot:}

put this in a command block and attach a comparator
1
Imadbush
06/25/2014 1:12 pm
Level 21 : Expert Network
/clear @p stone 0 0
Will testfor stone
Put that in a command blcok and attach a comparator
1

Welcome