1

Testfor Command help!

Pheonix_Flare's Avatar Pheonix_Flare6/25/14 12:27 pm
1 emeralds 487 8
6/25/2014 11:31 pm
Pheonix_Flare's Avatar Pheonix_Flare
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's Avatar
Pheonix_Flare
Level 1 : New Crafter
0

Create an account or sign in to comment.

8

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

Figured it out!
1
06/25/2014 11:16 pm
Level 20 : Expert Engineer
TheRedSkorpion
TheRedSkorpion's Avatar
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
06/25/2014 2:22 pm
Level 20 : Expert Network
Imadbush
Imadbush's Avatar
You could run
/setblock (coords of comparator) unpowered_comparator 0 destroy
Which will be like resetting the comparator
1
06/25/2014 1:56 pm
Level 1 : New Miner
CreativityKing
CreativityKing's Avatar
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
06/25/2014 1:39 pm
Level 1 : New Crafter
Pheonix_Flare
Pheonix_Flare's Avatar
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
06/25/2014 6:59 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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
06/25/2014 1:30 pm
Level 27 : Expert Engineer
kolokkol
kolokkol's Avatar
In the snapshots you can use:
/testfor @a {Inventory:[{Slot:,id:}],SelectedItemSlot:}

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

Website

© 2010 - 2024
www.planetminecraft.com

Welcome