Advertisement
Zeldaboy111

Multi block-structure ]|[ Skript #335

Aug 6th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. #multiblock structure
  2. #rename function
  3.  
  4. #requires: SkQuery, SkRayFall, Skellett, SkBee
  5.  
  6.  
  7. options:
  8. logo: &6&lBS&8:&7
  9.  
  10. function gui(p: Player):
  11. open chest with 6 rows named "&8Anvil" to {_p}
  12. wait 2 ticks
  13. loop 9 times:
  14. set slot loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
  15. set slot 54-loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
  16.  
  17. loop 5 times:
  18. set slot loop-value * 9 of {_p}'s current inventory to gray stained glass pane named "&8"
  19. set slot loop-value * 9-1 of {_p}'s current inventory to gray stained glass pane named "&8"
  20.  
  21. function isFurnace1(below: Location) :: boolean:
  22. if block at {_below} is campfire:
  23. set {_xAdjust::*} to 1, 1, 1, 0, 0, -1, -1 and -1
  24. set {_zAdjust::*} to 1, 0, -1, 1, -1, 1, 0 and -1
  25. loop 8 times:
  26. set {_checkLoc} to location at x-coordinate of {_below}+{_xAdjust::%loop-value%}, y-coordinate of {_below}, z-coordinate of {_below}+{_zAdjust::%loop-value%} in world of {_below}
  27. if block at {_checkLoc} is not red brick block:
  28. return false
  29. else:
  30. return false
  31. return true
  32.  
  33. function isFurnace2(loc: Location) :: boolean:
  34.  
  35. if block at {_loc} is not blast furnace:
  36. return false
  37.  
  38. set {_layer1::*} to air, brick slab, red brick block, air, red brick block, air, red brick block and brick slab
  39. set {_layer2::*} to air, red brick stair, eastward red brick stair and southward red brick stair
  40. set {_x::*} to 1, 1, 0, -1, -1, -1, 0 and 1
  41. set {_z::*} to 0, 1, 1, 1, 0, -1, -1 and -1
  42.  
  43. #Facing East
  44. set {_base} to -1
  45. if block at location at x-coordinate of {_loc} + {_x::1}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::1} in world of {_loc} is {_layer1::1}:
  46. set {_base} to 0
  47.  
  48.  
  49.  
  50. if {_base} is not -1:
  51. loop 7 times:
  52. if block at location at x-coordinate of {_loc} + {_x::%loop-value%}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::%loop-value%} in world of {_loc} is not {_layer1::%loop-value%}:
  53. return false
  54.  
  55. if block at location 1 meters above {_loc} is top westward red brick stair:
  56. set {_current} to 1
  57. loop 4 times:
  58. set {_check} to location at x-coordinate of {_loc} + {_x::%{_current}%}, y-coordinate of {_loc} + 1, z-coordinate of {_loc} + {_z::%{_current}%} in world of {_loc}
  59. if block at {_check} is not {_layer2::%loop-value%}:
  60. return false
  61. else if "%block at {_check}%" starts with "top":
  62. return false
  63. add 2 to {_current}
  64.  
  65. if block at location 2 meters above {_loc} is not red brick block:
  66. return false
  67. else:
  68. return false
  69. else:
  70. return false
  71. return true
  72.  
  73.  
  74. on rightclick on smooth stone:
  75. if player is not sneaking:
  76. if {anvil.%location of clicked block%} is true:
  77. gui(player)
  78. cancel event
  79.  
  80. on rightclick on cauldron:
  81. if {furnace.%location of event-block%} is true:
  82. if isFurnace1(location 1 meters below clicked block):
  83. cancel event
  84. send "WIP"
  85. else:
  86. delete {furnace.%location of event-block%}
  87.  
  88. on rightclick on blast furnace:
  89. if {furnace2.%location of event-block%} is true:
  90. if isFurnace2(location of clicked block):
  91. cancel event
  92. send "WIP"
  93. else:
  94. delete {furnace2.%location of event-block%}
  95.  
  96. on rightclick holding stone axe:
  97. if clicked block is smooth stone or iron block or diamond block:
  98. if {anvil.%location of event-block%} is not true:
  99. set {anvil.%location of event-block%} to true
  100. set {_tier} to "Tier I"
  101. if clicked block is smooth stone:
  102. set {anvil.%location of event-block%.tier} to 1
  103. else if clicked block is iron block:
  104. set {anvil.%location of event-block%.tier} to 2
  105. set {_tier} to "Tier II"
  106. else:
  107. set {anvil.%location of event-block%.tier} to 3
  108. set {_tier} to "Tier III"
  109.  
  110. set {_s} to 6
  111. loop all players in radius 6 around event-block:
  112. set {_v} to ({_s} - distance between loop-player and event-block)
  113. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  114.  
  115. send "{@logo} Successfully created an anvil of %{_tier}%."
  116. summon armor stand at location 0.6 meters below event-block
  117. set name of last spawned armor stand to "&7Anvil"
  118. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  119.  
  120. summon armor stand at location 0.9 meters below event-block
  121. set name of last spawned armor stand to "&7%{_tier}%"
  122. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  123.  
  124. else if clicked block is cauldron:
  125. if isFurnace1(location 1 meters below clicked block):
  126. set {furnace.%location of event-block%} to true
  127.  
  128. else if clicked block is blast furnace:
  129. if isFurnace2(location of clicked block):
  130. set {furnace2.%location of event-block%} to true
  131.  
  132. on break of smooth stone or iron block or diamond block:
  133. if {anvil.%location of event-block%} is true:
  134. set {_s} to 6
  135. loop all players in radius 6 around event-block:
  136. set {_v} to ({_s} - distance between loop-player and event-block)
  137. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  138. delete {anvil.%location of event-block%}
  139. delete {anvil.%location of event-block%.tier}
  140. loop entities in radius 1 around event-block:
  141. if type of loop-entity is armor stand:
  142. kill loop-entity
  143.  
  144.  
  145. on inventory click:
  146. if type of clicked inventory is chest inventory:
  147. if inventory name of player's current inventory is "&8Anvil":
  148. cancel event
  149.  
  150. command /stair:
  151. trigger:
  152. send "%block 1 meters below player%"
  153.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement