Zeldaboy111

Tier I Smeltery ]|[ Skript #332

Aug 2nd, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 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.  
  34. on rightclick on smooth stone:
  35. if player is not sneaking:
  36. if {anvil.%location of clicked block%} is true:
  37. gui(player)
  38. cancel event
  39.  
  40. on rightclick on cauldron:
  41. if {furnace.%location of event-block%} is true:
  42. if isFurnace1(location 1 meters below clicked block):
  43. cancel event
  44. send "WIP"
  45. else:
  46. delete {furnace.%location of event-block%}
  47.  
  48. on rightclick holding stone axe:
  49. if clicked block is smooth stone or iron block or diamond block:
  50. if {anvil.%location of event-block%} is not true:
  51. set {anvil.%location of event-block%} to true
  52. set {_tier} to "Tier I"
  53. if clicked block is smooth stone:
  54. set {anvil.%location of event-block%.tier} to 1
  55. else if clicked block is iron block:
  56. set {anvil.%location of event-block%.tier} to 2
  57. set {_tier} to "Tier II"
  58. else:
  59. set {anvil.%location of event-block%.tier} to 3
  60. set {_tier} to "Tier III"
  61.  
  62. set {_s} to 6
  63. loop all players in radius 6 around event-block:
  64. set {_v} to ({_s} - distance between loop-player and event-block)
  65. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  66.  
  67. send "{@logo} Successfully created an anvil of %{_tier}%."
  68. summon armor stand at location 0.6 meters below event-block
  69. set name of last spawned armor stand to "&7Anvil"
  70. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  71.  
  72. summon armor stand at location 0.9 meters below event-block
  73. set name of last spawned armor stand to "&7%{_tier}%"
  74. add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
  75.  
  76. else if clicked block is cauldron:
  77. if isFurnace1(location 1 meters below clicked block):
  78. set {furnace.%location of event-block%} to true
  79.  
  80. else if clicked block is blast furnace:
  81.  
  82. on break of smooth stone or iron block or diamond block:
  83. if {anvil.%location of event-block%} is true:
  84. set {_s} to 6
  85. loop all players in radius 6 around event-block:
  86. set {_v} to ({_s} - distance between loop-player and event-block)
  87. play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
  88. delete {anvil.%location of event-block%}
  89. delete {anvil.%location of event-block%.tier}
  90. loop entities in radius 1 around event-block:
  91. if type of loop-entity is armor stand:
  92. kill loop-entity
  93.  
  94.  
  95. on inventory click:
  96. if type of clicked inventory is chest inventory:
  97. if inventory name of player's current inventory is "&8Anvil":
  98. cancel event
  99.  
  100. command /stair:
  101. trigger:
  102. send "%block 1 meters below player%"
  103.  
Add Comment
Please, Sign In to add comment