1

/testfor <item>

EdFi's Avatar EdFi10/11/15 1:31 pm
1 emeralds 235 2
10/11/2015 2:08 pm
EdFi's Avatar EdFi
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 EdFi's Avatar
EdFi
Level 6 : Apprentice Explorer
4

Create an account or sign in to comment.

2

1
10/11/2015 2:08 pm
Level 6 : Apprentice Explorer
EdFi
EdFi's Avatar
Yes, that's it! Thanks!
1
10/11/2015 1:43 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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

Website

© 2010 - 2024
www.planetminecraft.com

Welcome