Zeldaboy111

Multi Block-Structure ]|[ Skript #331

Aug 2nd, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. #multiblock structure
  2. #rename function
  3.  
  4. options:
  5. logo: &6&lBS&8:&7
  6.  
  7. function gui(p: Player):
  8. open chest with 6 rows named "&8Anvil" to {_p}
  9. wait 2 ticks
  10. loop 9 times:
  11. set slot loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
  12. set slot 54-loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
  13.  
  14. loop 5 times:
  15. set slot loop-value * 9 of {_p}'s current inventory to gray stained glass pane named "&8"
  16. set slot loop-value * 9-1 of {_p}'s current inventory to gray stained glass pane named "&8"
  17.  
  18. function isFurnace1(below: Location) :: boolean:
  19. if block at {_below} is campfire:
  20. set {_xAdjust::*} to 1, 1, 1, 0, 0, -1, -1 and -1
  21. set {_zAdjust::*} to 1, 0, -1, 1, -1, 1, 0 and -1
  22. loop 8 times:
  23. set {_checkLoc} to x-coordinate of {_below}+{_xAdjust::%loop-value%}, y-coordinate of {_below}, z-coordinate of {_below}+{_zAdjust::%loop-value%} in world of {_below}x-coordinate of {_below}+{_xAdjust::%loop-value%}, y-coordinate of {_below}, z-coordinate of {_below}+{_zAdjust::%loop-value%} in world of {_below}
  24. if block at {_checkLoc} is bricks:
  25. return true
  26.  
  27. return false
  28.  
  29. on rightclick on smooth stone:
  30. if player is not sneaking:
  31. if {anvil.%location of clicked block%} is true:
  32. gui(player)
  33. cancel event
  34.  
  35. on rightclick holding stone axe:
  36. if clicked block is smooth stone or iron block or diamond block:
  37. if {anvil.%location of event-block%} is not true:
  38. set {anvil.%location of event-block%} to true
  39. set {_tier} to "Tier I"
  40. if clicked block is smooth stone:
  41. set {anvil.%location of event-block%.tier} to 1
  42. else if clicked block is iron block:
  43. set {anvil.%location of event-block%.tier} to 2
  44. set {_tier} to "Tier II"
  45. else:
  46. set {anvil.%location of event-block%.tier} to 3
  47. set {_tier} to "Tier III"
  48.  
  49. set {_s} to 6
  50. loop all players in radius 6 around event-block:
  51. set {_v} to ({_s} - distance between loop-player and event-block)
  52. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  53.  
  54. send "{@logo} Successfully created an anvil of %{_tier}%."
  55. summon armor stand at location 0.7 meters below event-block
  56. set name of last spawned armor stand to "&7%{_tier}%"
  57. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  58.  
  59. else if clicked block is cauldron:
  60. set {_below} to location 1 meters below clicked block
  61. if isFurnace1({_below}):
  62. set {furnace.%location of event-block%} to true
  63.  
  64.  
  65.  
  66. else if clicked block is blast furnace:
  67.  
  68. on break of smooth stone or iron block or diamond block:
  69. if {anvil.%location of event-block%} is true:
  70. set {_s} to 6
  71. loop all players in radius 6 around event-block:
  72. set {_v} to ({_s} - distance between loop-player and event-block)
  73. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  74. delete {anvil.%location of event-block%}
  75. delete {anvil.%location of event-block%.tier}
  76. loop entities in radius 1 around event-block:
  77. if type of loop-entity is armor stand:
  78. kill loop-entity
  79.  
  80.  
  81. on inventory click:
  82. if type of clicked inventory is chest inventory:
  83. if inventory name of player's current inventory is "&8Anvil":
  84. cancel event
  85.  
  86. command /stair:
  87. trigger:
  88. send "%block 1 meters below player%"
  89.  
Add Comment
Please, Sign In to add comment