Advertisement
Zeldaboy111

Directionele Multi block-structure ]|[ Skript #336

Aug 10th, 2020
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 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 -2
  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 -1
  47.  
  48. #Facing south
  49. else if block at location at x-coordinate of {_loc} + {_x::3}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::3} in world of {_loc} is {_layer1::1}:
  50. set {_base} to 2
  51.  
  52. else if block at location at x-coordinate of {_loc} + {_x::5}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::5} in world of {_loc} is {_layer1::1}:
  53. set {_base} to 4
  54.  
  55. else if block at location at x-coordinate of {_loc} + {_x::7}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::7} in world of {_loc} is {_layer1::1}:
  56. set {_base} to 6
  57.  
  58. if {_base} is not -2:
  59. set {_baseDefault} to {_base}
  60. loop 7 times:
  61. if loop-value + {_base} > size of {_x::*}:
  62. set {_base} to size of {_x::*}
  63. set {_value} to {_base} + loop-value
  64. if {_base} is not {_baseDefault}:
  65. set {_value} to {_base} - loop-value
  66.  
  67. if block at location at x-coordinate of {_loc} + {_x::%{_value}%}, y-coordinate of {_loc}, z-coordinate of {_loc} + {_z::%{_value}%} in world of {_loc} is not {_layer1::%loop-value%}:
  68. return false
  69.  
  70.  
  71. set {_base} to {_baseDefault}
  72. if block at location 1 meters above {_loc} is top westward red brick stair:
  73. set {_current} to 1
  74. loop 4 times:
  75. 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}
  76. if block at {_check} is not {_layer2::%loop-value%}:
  77. return false
  78. else if "%block at {_check}%" starts with "top":
  79. return false
  80. add 2 to {_current}
  81.  
  82. if block at location 2 meters above {_loc} is not red brick block:
  83. return false
  84. else:
  85. return false
  86. else:
  87. return false
  88. return true
  89.  
  90.  
  91. on rightclick on smooth stone:
  92. if player is not sneaking:
  93. if {anvil.%location of clicked block%} is true:
  94. gui(player)
  95. cancel event
  96.  
  97. on rightclick on cauldron:
  98. if {furnace.%location of event-block%} is true:
  99. if isFurnace1(location 1 meters below clicked block):
  100. cancel event
  101. send "WIP"
  102. else:
  103. delete {furnace.%location of event-block%}
  104.  
  105. on rightclick on blast furnace:
  106. if {furnace2.%location of event-block%} is true:
  107. if isFurnace2(location of clicked block):
  108. cancel event
  109. send "WIP"
  110. else:
  111. delete {furnace2.%location of event-block%}
  112.  
  113. on rightclick holding stone axe:
  114. if clicked block is smooth stone or iron block or diamond block:
  115. if {anvil.%location of event-block%} is not true:
  116. set {anvil.%location of event-block%} to true
  117. set {_tier} to "Tier I"
  118. if clicked block is smooth stone:
  119. set {anvil.%location of event-block%.tier} to 1
  120. else if clicked block is iron block:
  121. set {anvil.%location of event-block%.tier} to 2
  122. set {_tier} to "Tier II"
  123. else:
  124. set {anvil.%location of event-block%.tier} to 3
  125. set {_tier} to "Tier III"
  126.  
  127. set {_s} to 6
  128. loop all players in radius 6 around event-block:
  129. set {_v} to ({_s} - distance between loop-player and event-block)
  130. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  131.  
  132. send "{@logo} Successfully created an anvil of %{_tier}%."
  133. summon armor stand at location 0.6 meters below event-block
  134. set name of last spawned armor stand to "&7Anvil"
  135. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  136.  
  137. summon armor stand at location 0.9 meters below event-block
  138. set name of last spawned armor stand to "&7%{_tier}%"
  139. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  140.  
  141. else if clicked block is cauldron:
  142. if isFurnace1(location 1 meters below clicked block):
  143. set {furnace.%location of event-block%} to true
  144.  
  145. else if clicked block is blast furnace:
  146. if isFurnace2(location of clicked block):
  147. set {furnace2.%location of event-block%} to true
  148.  
  149. on break of smooth stone or iron block or diamond block:
  150. if {anvil.%location of event-block%} is true:
  151. set {_s} to 6
  152. loop all players in radius 6 around event-block:
  153. set {_v} to ({_s} - distance between loop-player and event-block)
  154. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  155. delete {anvil.%location of event-block%}
  156. delete {anvil.%location of event-block%.tier}
  157. loop entities in radius 1 around event-block:
  158. if type of loop-entity is armor stand:
  159. kill loop-entity
  160.  
  161.  
  162. on inventory click:
  163. if type of clicked inventory is chest inventory:
  164. if inventory name of player's current inventory is "&8Anvil":
  165. cancel event
  166.  
  167. command /stair:
  168. trigger:
  169. send "%block 1 meters below player%"
  170.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement