0

I have a 2 tick repeater clock hooked up to a command block with this command in it...

testfor @p {SelectedItem:{id:minecraft:tripwire_hook,display:{Name:"Key to a House"}}}

When I hold the key, the comparator doesn't go on, and the door doesn't open.

3
  • MBraedley, this is only 1 command block for easier door opening on my server. I do use fill / setblock clocks when making contraptions though, so don't worry. Sep 12, 2015 at 0:39
  • Even still, don't drop into bad habits. A setblock clock will also be less laggy than whatever clock you have set up, even if the difference is quite minor.
    – MBraedley
    Sep 12, 2015 at 0:41

1 Answer 1

4

The SelectedItem uses the Item Structure, and under Item Structure there is no display tag. The display tag lies under the tag tag.

testfor @p {SelectedItem:{id:minecraft:tripwire_hook,tag:{display:{Name:"Key to a House"}}}}

Also note it is suggested to use @a selector instead of @p. Using @p will only activate if the player closest is holding the item.

1
  • 2
    You should mark @ModDL's answer as accepted by clicking the checkmark underneath the score if this solved your problem.
    – MBraedley
    Sep 12, 2015 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .