forum Forumsplay_arrow Minecraft fiber_manual_record Redstone


/testfor <item>

1 emerald2 replies171 views
created 10/11/2015 1:31 pm by EdFi
last reply 10/11/2015 2:08 pm
I'm creating an adventure map, and I want to use tripwire hooks as keycards so when you press a button (with the tripwire hook in your hand) the /testfor command will detect the item and then activate the redstone. The name of the tripwire hook will be Keycard A. How do I do it?
Posted by avatar
Level 6 : Apprentice Explorer

comment Login or register to post a reply.

2 replies

10/11/2015 2:08 pm
Level 6 : Apprentice Explorer
Yes, that's it! Thanks!
10/11/2015 1:43 pm
Level 28 : Expert Engineer
If you want the keycard to be the item in their hand, then you can do this with the 'SelectedItem' tag.testfor @a {SelectedItem:{id:"minecraft:tripwire_hook",Count:1b,tag:{display:{Name:"Keycard A"}}}}
Obviously you can change the name to different things if you have different keycards, but this format should work for all of them.

Planet Minecraft



© 2010 - 2019