I came to this website to uncover some answers just how to lock a door with commands for mine minecraft fear game. I was pretty mindful that this method only works for 1.8, yet now I"m curious if there"s any other commands that have the right to be offered to lock a door for 1.12.2 or higher.

You are watching: How to lock doors in minecraft


*

You have the right to do this by utilizing invisible armor stands that blocks the door so they can"t appropriate click it. So here are the actions for it.

Get the cordinates infront the the door.

Then use this command and change 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 feet door. So now reapet the second step but now compose .2 - .4 - .6 - .8 ifront that the X or Z cordinate (depents on were it"s facing) therefore 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 need to the exact same thing but now you need to include 1 come Y.

If you must unlock the door, then location this command:

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

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

/kill
e

IF YOU require DIFFRENT secrets AND an ext KEYS, THEN name THE ARMOR was standing BY adding THIS come THE ARMOR was standing COMMAND CustomName:"Door1" and also then use this command because that the key:

/kill
e

To acquire the crucial use this: /give
p minecraft:WHATEVER_ITEM 1 0 display:Name:Key Name

Example: we say the the cordinates infront that the door is 1460 4 -150. Climate we carry out this.

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

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

And reapet until 0.8. Then you include 1 on Y so it will be like 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 an essential and your done


share
improve this answer
follow
edited Mar 20 "18 in ~ 13:49
answer Mar 19 "18 in ~ 18:52
*

ErramErram
16022 silver badges1313 bronze badges
include a comment |
0
/blockdata ~ ~-2 ~ Lock:KeyYes, I"m using commandfor locking the doorhe opened if you open with item renamed "Key"


re-superstructure
improve this price
follow
edited Jun 4 "19 at 7:06
*

Glorfindel
1,21122 gold badges1616 silver badges2828 bronze badges
reply Jun 4 "19 in ~ 3:52
*

Zero10Zero10
1
add a comment |

her Answer


Thanks for contributing solution to Arqade!

Please be certain to answer the question. Provide details and 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 referrals or personal experience.

To discover more, check out our advice on writing an excellent answers.

See more: Answered: What Is The Common Name Of The Following Compound? ? 0


Draft saved
Draft discarded

Sign up or log in in


sign up using Google
sign up utilizing Facebook
sign up using Email and also Password
submit

Post together a guest


name
email Required, yet never shown


Post together a guest


surname
email

Required, yet never shown


write-up Your prize Discard

By click “Post her Answer”, you agree to our terms of service, privacy policy and cookie policy


Not the prize you're spring for? Browse other questions tagged minecraft-java-edition minecraft-commands or questioning your very own question.


Screenshot of the mainly
*

mine pumpkin patch from my city in pet Crossing brand-new Horizons by GammaGames
send your picture Hall of call
Featured top top Meta
associated
3
How deserve to I create a copy of one entity making use of command blocks?
1
how to compensation player on every death in Minecraft utilizing command blocks?
3
how do I recognize which hopper the user clicked in Minecraft through command blocks?
3
Minecraft - execute command experimentation logic (lightning Sword)
0
just how to readjust the biome, or at the very least the grass color, without mods in Minecraft
1
Minecraft : difficulty with 1.9 command block
1
Minecraft Command Blocks, utilizing /data string worths within other commands
warm Network questions an ext hot concerns

question feed
i ordered it to RSS
inquiry feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader.


Arqade
firm
stack Exchange Network
site design / logo © 2021 stack Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.11.12.40742


Arqade works ideal with JavaScript enabled
*

her privacy

By click “Accept every cookies”, girlfriend agree ridge Exchange have the right to store cookies on your machine and disclose info in accordance v our Cookie Policy.