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?
Create an account or sign in to comment.
2
1
Yes, that's it! Thanks!
1
If you want the keycard to be the item in their hand, then you can do this with the 'SelectedItem' tag.
Obviously you can change the name to different things if you have different keycards, but this format should work for all of them.
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.