I need some command block help with a MC map ...

Discussion in 'Off-Topic' started by Robo, Apr 24, 2017.

  1. Robo
    Offline

    Robo Boss Member

    Messages:
    845
    Last edited: Apr 24, 2017
  2. Ares_Xena
    Offline

    Ares_Xena Legendary Member

    Messages:
    4,091
    Are you talking about the SerialKey plugin? Purty sure you can download that off of Bukkit or find similar versions of it on Spigot.
     
  3. Robo
    Offline

    Robo Boss Member

    Messages:
    845
  4. Mega_
    Offline

    Mega_ Legendary Member

    Messages:
    2,911
    Just use a plugin. It will be easier to customise and you won't need to place a command block anywhere.
     
  5. Robo
    Offline

    Robo Boss Member

    Messages:
    845
    This is in a singleplayer world i cant get the plugin
     
  6. Watermelonone
    Offline

    Watermelonone Boss Member

    Messages:
    613
    No one is going to tell you if you call them "nerdy"
     
  7. AGuyWithAHat
    Offline

    AGuyWithAHat Active Member

    Messages:
    8
    I can help, well it'd be easier if you just used a hopper to use the key and only one specific item will be able to open the door, i can do that
     
  8. sircorgi
    Offline

    sircorgi Boss Member

    Messages:
    5,642
    little things make a big difference. People will think a map creator really put in effort if the players had to right click the door with a key instead of throwing it. It just makes the map more realistic.
    --
    Anyhoo, I just simplified (I tried my best) what the best answer was.

    1. First of all, type the command below and replace X Y Z with the co-ordinates of the bottom block/part of your door (As we all know, doors are two blocks high, get the coords of the bottom one)
    • /summon ArmorStand X Y Z {CustomName:"keyDetector",Invisible:1,Invulnerable:1}
    2. What you need to do next is place a command block, and set it to "repeating" (The purple command block). Set it to "Always Active" and put down the command below
    • /scoreboard players tag @a add hasKey {Inventory:[{tag:{display:{Name:"Key"}}}]
    3. Then, place another one and set that as a "chain" command block (green one). Make sure to set it as "Always Active" as well. Put down the command below:
    • /execute @a[tag=hasKey] ~ ~ ~ /execute @e[name=keyDetector,type=ArmorStand] ~ ~ ~ /setblock ~ ~ ~ iron_door 4
    4. Do the same from step 3 but this time, put this command below:
    • /execute @a[tag=hasKey] ~ ~ ~ /execute @e[name=keyDetector,type=ArmorStand] ~ ~ ~ /setblock ~ ~1 ~ iron_door 9
    Make sure the command blocks look like this
    [​IMG]



    if this doesn't work then it might be the numbers at the end of the two last commands. (4 on the second one, 9 on the last one)
     
  9. Robo
    Offline

    Robo Boss Member

    Messages:
    845
    Thanks a lot! I will try it and reply back if it worked. Thanks again!
     

Share This Page