Minecraft Maps / Redstone Device

Compact Combination Lock (14w20b)

  • 1,389 views, 2 today
  • 32 downloads, 0 today
  • 24
  • 2
  • 12
Mgreat's Avatar Mgreat
Retired Moderator
Level 56 : Grandmaster Taco
688
Hello and welcome. Today I'm going to show you my compact redstone combination lock. This lock allows for up to 10 digit inputs, and a combination length, that is as long as a scoreboard objective will allow.

How to Use it

The lock is pretty simple, each section is labelled what it does, as well as a demonstration section. If you are importing this into a new world, using the MCEdit schematic, then you'll want to run the "New World Redstone Setup" section first (shown in the pictures, and labelled in the world). After this section has been run, or if you just loaded up the main world download, then we come to the next section. The combination input section, is where the users input the combination they think will work. It's pretty straight forward, and can easily have numbers taken out of the input, by just removing that row.

Spoiler - click to reveal
One Row
undefined

Be careful about removing the far left row though.
The final section, marked as the combination testing area, is where the user will find out if they have the correct combination or not. This area is pretty simple as well, as all you need to do is change  the two numbers in the command block that are checking for it.

Command: /scoreboard players test Combination Combination 12348 12348

How it Works

There are three scoreboard objectives, one that stores what the player has entered for the combination, and two others that I am using as a constant that I can easily multiply by. Whenever a player presses a button the combination input part, it does two things. Let's say the player pressed the button for 4. It multiplies the combination variable by 10 (if it's at zero this does nothing), and adds the number 4, to the combination objective (which starts at zero). The next time a player presses a button, let's say 6, it will multiply the combination objective by 10 (making it currently 40, instead of 4), and then adds a 6 onto it (making it 46). This process then continues for whenever a player presses a button on it.

For the multiplication and addition I am using two scoreboard objectives. To multiply the combination entered, by 10, I multiply it by an objective called timesten. Which for the combination "player" it is set to 10. Then for adding each number on, I have an objective called "number". This objective has the numbers, stored on a player with the exact same name as the number (1, 2, 3, 4, etc.). Then to add a number I simply reference the player 1, or 2, or 3, etc. of the "number" objective.

To reset the users inputed attempt on the combination, I just set the combination objective to 0.

To test if the player has the right number, I just use a test feature for scoreboard objectives that just tests the "Combination" objective for a certain range of numbers (if the two numbers of the range are exactly the same, it just checks for that one number). Then the comparator activates if the player got it right, and resets the "Combination" objective to zero, and can then activate something that you, the map creator has in your map.

Other

Thank you for reading, I hope this helps your map, and that the explaination is clear.

And as always:
undefined
Progress100% complete
Tags

Create an account or sign in to comment.

1
12/15/2014 12:27 am
Level 59 : Grandmaster Batman
Squirrel
Squirrel's Avatar
lol your puns are so ferny(funny)
1
12/16/2014 1:54 am
Level 56 : Grandmaster Taco
Mgreat
Mgreat's Avatar
Lol, thank you.
1
05/19/2014 6:44 pm
Level 1 : New Explorer
Nikki Luvs Mc
Nikki Luvs Mc's Avatar
Welcome 😄😃😀
1
05/19/2014 6:43 pm
Level 1 : New Explorer
Nikki Luvs Mc
Nikki Luvs Mc's Avatar
*job
1
05/19/2014 6:43 pm
Level 1 : New Explorer
Nikki Luvs Mc
Nikki Luvs Mc's Avatar
Well done good mod keep it up
1
05/19/2014 6:43 pm
Level 56 : Grandmaster Taco
Mgreat
Mgreat's Avatar
Thank you
1
05/19/2014 6:30 am
Level 8 : Apprentice Explorer
Nobody132
Nobody132's Avatar
Nice job dude.
1
05/19/2014 4:35 pm
Level 56 : Grandmaster Taco
Mgreat
Mgreat's Avatar
Thank you.
1
05/19/2014 2:02 am
Level 68 : High Grandmaster Senpai
Ludicrous
Ludicrous's Avatar
Still no idea how you do this
1
05/19/2014 4:35 pm
Level 56 : Grandmaster Taco
Mgreat
Mgreat's Avatar
Fine, just call it... magic. lel
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome