qmagnet

How to make a sliding door that goes up or down

Jul 18th, 2016
14,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. Top 3 ArmorStand rows for door
  2. /summon ArmorStand ~ ~-0.5 ~-18 {NoGravity:true,Invisible:true,Small:true,Marker:true,Tags:["GateStand"],Passengers:[{id:FallingSand,Block:stone,Tags:["FallingGateBlock"],NoGravity:true,DropItem:false,Time:-2147483648}]}
  3.  
  4. Bottom ArmorStand row for door
  5. /summon ArmorStand ~ ~-0.5 ~-18 {NoGravity:true,Invisible:true,Small:true,Marker:true,Tags:["GateStand","BottomGateStand"],Passengers:[{id:FallingSand,Block:stone,Tags:["FallingGateBlock"],NoGravity:true,DropItem:false,Time:-2147483648}]}
  6.  
  7.  
  8. NOTE:
  9. Coordinates are specific to the world shown in the video. You will need to adjust them for your own design
  10.  
  11.  
  12. Hopper Clock for Sound (alternates between 2 identical command blocks)
  13. /execute @e[tag=BottomGateStand] ~ ~ ~ playsound entity.minecart.riding master @a ~ ~ ~ 0.3 0.6 0
  14.  
  15.  
  16. Activate redstone block and stop sounds
  17. 1. /fill -934 56 -718 -934 56 -717 glass (at Hopper Clock)
  18. 2. /stopsound @a
  19. 3. /execute @e[tag=BottomGateStand] ~ ~ ~ playsound block.enderchest.open master @a ~ ~ ~ 1 1 0
  20. 4. /execute @e[tag=BottomGateStand] ~ ~ ~ playsound entity.irongolem.hurt master @a ~ ~ ~ 0.8 0.6 1
  21.  
  22. ---> After stopping sound, system runs through repeaters and activates UP or DOWN chain clock
  23.  
  24.  
  25. UP CHAIN CLOCK
  26. 1. Despawn time for FallingSand gets reset
  27. /entitydata @e[tag=FallingGateBlock] {Time:-2147483648}
  28.  
  29. 2. Door moves up
  30. /tp @e[type=ArmorStand,tag=GateStand] ~ ~0.01 ~
  31.  
  32. 3. Activate Sounds at Hopper Clock
  33. /fill -934 56 -718 -934 56 -717 quartz_block
  34.  
  35. 4. Place barriers so player cannot walk though door
  36. /execute @e[typeArmorStand,tag=GateStand] ~ ~ ~ fill ~ ~ ~ ~ ~ ~ barrier 0 replace air
  37.  
  38. 5. Remove barriers as door rises
  39. /execute @e[typeArmorStand,tag=BottomGateStand] ~ ~ ~ fill ~ ~-0.5 ~ ~ ~-0.5 ~ air 0 replace barrier
  40.  
  41. 6. Door checks for bedrock at high point
  42. /execute @e[typeArmorStand,tag=GateStand] ~ ~ ~ testforblock ~ ~1 ~ bedrock
  43.  
  44. 7. CONDITIONAL -> System shut off when door reaches bedrock (top)
  45. /setblock ~ ~ ~-7 air
  46.  
  47. 8. CONDITIONAL -> Stops sound (see SOUNDSTOPPER)
  48. /setblock ~-4 ~ ~1 redstone_block
  49.  
  50.  
  51. DOWN CHAIN CLOCK
  52. 1. Despawn time for FallingSand gets reset
  53. /entitydata @e[tag=FallingGateBlock] {Time:-2147483648}
  54.  
  55. 2. Door moves down
  56. /tp @e[type=ArmorStand,tag=GateStand] ~ ~-0.01 ~
  57.  
  58. 3. Activate Sounds at Hopper Clock
  59. /fill -934 56 -718 -934 56 -717 quartz_block
  60.  
  61. 4. Place barriers so player cannot walk though door
  62. /execute @e[typeArmorStand,tag=GateStand] ~ ~ ~ fill ~ ~ ~ ~ ~ ~ barrier 0 replace air
  63.  
  64. 5. Door checks for orange wool at low point
  65. /execute @e[typeArmorStand,tag=BottomGateStand] ~ ~ ~ testforblock ~ ~-1 ~ wool 1
  66.  
  67. 6. CONDITIONAL -> System shut off when door reaches orange wool bottom
  68. /setblock ~ ~ ~-7 air
  69.  
  70. 7. CONDITIONAL -> Door jumps 0.02 blocks from bottom (so floor is not removed)
  71. /tp @e[type=ArmorStand,tag=GateStand] ~ ~0.02 ~
  72.  
  73. 8. CONDITIONAL -> Stops sound (see SOUNDSTOPPER)
  74. /setblock ~-2 ~ ~ redstone_block
  75.  
  76.  
  77. SOUNDSTOPPER
  78. 1. /fill -934 56 -718 -934 56 -717 glass
  79. 2. Repeater
  80. 3. /stopsound @a
  81. 4. /execute @e[tag=BottomGateStand] ~ ~ ~ playsound entity.irongolem.hurt master @a ~ ~ ~ 0.8 0.6 1
  82. 5. /execute @e[tag=BottomGateStand] ~ ~ ~ playsound block.enderchest.open master @a ~ ~ ~ 1 1 0
  83.  
  84.  
  85.  
  86.  
  87. See video for more detail:
  88. https://www.youtube.com/watch?v=5Dg64qPGQTA
Advertisement
Add Comment
Please, Sign In to add comment