Forum Thread: Minecraft-How to Make a Password Combination Lock

In minecraft we can do a lot of things, like building houses, build machine, etc. in this article I want to show you how to make a password to your minecraft door.

I hope it will be useful to readers. The video is on Indonesia language but if you dont understand Indonesia you can press subtitle button or just see the video :D. The video actually pretty simple and useful when you want to protect your stuff from other players and you can set the code to the door easily.

1 Response

Code lock

Let's see how a code lock program is written. For those not interested, you can simply copy the code and paste it into the "startup" file. First, we need to craft the computer itself:

Ingredients
Stone +
Red dust +
Glass panel
Console

You can also use an advanced computer. Next, we put the computer near the door and turn it on with the right mouse button. To make the lock program the default, we will write it to the "startup" file. To do this, write the command in the console

edit startup

The code editor window opens. Here is the code for our program:

os.pullEvent = os.pullEventRaw

while true do
term.clear ()
term.setCursorPos (1, 1)
print ("Enter your password, please!")
write ("Password:")
pwd = read ("*")
if pwd == "password" then
print ("Live granted.")
rs.setOutput ("left", true)
sleep (3)
rs.setOutput ("left", false)
if pwd == "kill" then
print ("Death granted.")
rs.setOutput ("right", true)
sleep (2)
rs.setOutput ("right", false)
else
print ("Access denied.")
sleep (2)
end
end

Share Your Thoughts

  • Hot
  • Active