I concerned this website to find some answers how to lock a door with commands for my minecraft fear game. I was pretty aware that this method only works for 1.8, however now I"m curious if there"s any other commands that deserve to be supplied to lock a door for 1.12.2 or higher.

You are watching: Minecraft how to lock a door

You have the right to do this by making use of invisible armor stands the blocks the door therefore they can"t right click it. So right here are the measures for it.

Get the cordinates infront the the door.

Then use this command and readjust the X Y Z /summon armor_stand X Y Z Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoBasePlate:1b,NoGravity:1b,DisabledSlots:31.

Now you have to use decimals to block the hole door. So now reapet the 2nd step however now write .2 - .4 - .6 - .8 ifront of the X or Z cordinate (depents on were it"s facing) so etc:

/summon armor_stand X.2 Y Z Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoBasePlate:1b,NoGravity:1b,DisabledSlots:31

If there is no roof end the door climate you have to the exact same thing yet now you require to add 1 come Y.

If you have to unlock the door, then ar this command:

/testfor
a SelectedItem:id:"minecraft:ANYITEM",tag:display:Name:"KEY NAME"

In a reapiting always energetic command block and then place this into a condential chain, always active command block:

/kill
e

IF YOU need DIFFRENT tricks AND much more KEYS, THEN name THE ARMOR stand BY adding THIS come THE ARMOR was standing COMMAND CustomName:"Door1" and also then use this command because that the key:

/kill
e

To gain the key use this: /give
p minecraft:WHATEVER_ITEM 1 0 display:Name:Key Name

Example: us say the the cordinates infront the the door is 1460 4 -150. Then we execute this.

First we summon the armor stand ifront that the door: /summon armor_stand 1460 4 -150 Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoBasePlate:1b,NoGravity:1b,DisabledSlots:31

Now we do the this: /summon armor_stand 1460.2 4 -150 Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoBasePlate:1b,NoGravity:1b,DisabledSlots:31

And reapet till 0.8. Climate you include 1 ~ above Y so it will certainly be choose this:/summon armor_stand 1460 5 -150 Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoBasePlate:1b,NoGravity:1b,DisabledSlots:31

And reapet until .8 currently you have actually to offer yourself the key and her done

share
enhance this price
follow
edited Mar 20 "18 at 13:49
answered Mar 19 "18 in ~ 18:52

ErramErram
include a comment |
0
/blockdata ~ ~-2 ~ Lock:KeyYes, I"m utilizing commandfor locking the doorhe opened if you open up with item renamed "Key"

re-superstructure
improve this prize
monitor
edited Jun 4 "19 in ~ 7:06

Glorfindel
reply Jun 4 "19 in ~ 3:52

Zero10Zero10
1
include a comment |

Please be sure to answer the question. Provide details and also share her research!

But avoid

Asking because that help, clarification, or responding to various other answers.Making statements based upon opinion; earlier them increase with references or an individual experience.

See more: How Far Is A Click In Distance Of 1 Click? How Far Is A Klick In Distance

Draft saved

authorize up using Email and also Password
send

### Post together a guest

name
email Required, but never shown

### Post together a guest

surname
email

Required, yet never shown

## Not the answer you're spring for? Browse various other questions tagged minecraft-java-edition minecraft-commands or asking your own question.

Screenshot of the mainly

I like to speak to this one “Dank Mario” indigenous Super Mario Odyssey by Morgan
send your photograph Hall of reputation
Featured ~ above Meta
connected
3
How have the right to I develop a copy of one entity utilizing command blocks?
1
exactly how to award player on every kill in Minecraft making use of command blocks?
3
just how do I determine which hopper the user clicked in Minecraft through command blocks?
3
Minecraft - execute command trial and error logic (lightning Sword)
0
exactly how to adjust the biome, or at least the grass color, without mods in Minecraft
1
Minecraft : problem with 1.9 command blocks
1
Minecraft Command Blocks, making use of /data string values within other commands
warm Network questions much more hot inquiries

inquiry feed