How to use a command block to lock/unlock doors?
How do you use command blocks to lock/unlock doors? I tried to use the block data command but is saying that it needs to be a holder block like chests. And what I want it to do is to also lock/unlock doors. How do I do that?
3 Answers
Use the following command in a repeating cmd block
/Clone (area of a door) (area of the top half of door) (where you want the bottom half of locked door)
You can even use a wood door to do this. I tried to get past this, but the door was constantly shutting in my face before I can get through
2You can't currently. Locking only works on containers, not on doors or trapdoors.
0You can put in your command block /fill x y z x y z or /clone x y z x y z x y z If you want it to open in parts add more command blocks in smaller increments and put delays in or on them. You can also put the second and so-on to chain if they are placed with the arrows pointing to the next one.
You can also add a lock function py using a lever and a sticky piston with a block on it, to block the signal to open it.