-2

This question already has an answer here:

I'm in Minecraft Pocket Edition. My command block is set to repeating and always active. I have it attached to a comparator that runs into a block with an iron door on top. The command input I have is

/clear @p[x=~0,y=~0,z=~-2,r=2] tripwire_hook 0 0 {display:{Name:”key”}}

The IDEA is to set off the command block whenever the tripwire hook is within 2 blocks of the door. This works fine UNTIL I try adding the custom name. The Previous Output box keeps saying:

Syntax error: Unexpected “{“: at “_hook 0 0 >>{<

any ideas on how to fix this syntax error? If you don't, do you have any other ways to lock a door and open it when you have a custom names item?

marked as duplicate by Fabian Röling, Virusbomb, IronAnvil, arghtype, Timmy Jim Apr 28 '18 at 19:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

This may work if you have patience and time. Try to build this thing that you need to drop a specific item (I recommend a written book) in front of the door, which turns off a repeating command block that is constantly cloning a closed door to that location. If all goes well, dropping a book then trying to open the door and it works, then you are good!

The command I recommend is /clone (coordinates of the bottom half of a closed door) (coordinates of the top half of door) (where you want the door to be)

Set it to a repeating but requires red stone command block If you don’t know how to make such thing, go to YouTube to look for answers

Not the answer you're looking for? Browse other questions tagged or ask your own question.