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 3


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

  • What's the command?
    – user210782
    Commented Apr 30, 2018 at 14:49
  • @user210782 the command is
    – KtheVeg
    Commented May 2, 2018 at 0:20

You can't currently. Locking only works on containers, not on doors or trapdoors.


You 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.

You must log in to answer this question.

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