Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #multiblock structure
- #rename function
- #requires: SkQuery, SkRayFall, Skellett, SkBee
- options:
- logo: &6&lBS&8:&7
- function gui(p: Player):
- open chest with 6 rows named "&8Anvil" to {_p}
- wait 2 ticks
- loop 9 times:
- set slot loop-value - 1 of {_p}'s current inventory to gray stained glass pane named "&8"
- set slot 54-loop-value of {_p}'s current inventory to gray stained glass pane named "&8"
- loop 5 times:
- set slot loop-value * 9 of {_p}'s current inventory to gray stained glass pane named "&8"
- set slot loop-value * 9-1 of {_p}'s current inventory to gray stained glass pane named "&8"
- function isFurnace1(below: Location) :: boolean:
- if block at {_below} is campfire:
- set {_xAdjust::*} to 1, 1, 1, 0, 0, -1, -1 and -1
- set {_zAdjust::*} to 1, 0, -1, 1, -1, 1, 0 and -1
- loop 8 times:
- 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}
- if block at {_checkLoc} is not red brick block:
- return false
- else:
- return false
- return true
- function isFurnace2(loc: Location) :: boolean:
- if block at {_loc} is not blast furnace:
- return false
- set {_layer1::*} to air, brick slab, red brick block, air, red brick block, air, red brick block and brick slab
- set {_layer2::*} to air, red brick stair, eastward red brick stair and southward red brick stair
- set {_x::*} to 1, 1, 0, -1, -1, -1, 0 and 1
- set {_z::*} to 0, 1, 1, 1, 0, -1, -1 and -1
- #Facing East
- set {_base} to -2
- 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}:
- set {_base} to -1
- #Facing south
- 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}:
- set {_base} to 2
- 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}:
- set {_base} to 4
- 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}:
- set {_base} to 6
- if {_base} is not -2:
- set {_baseDefault} to {_base}
- loop 7 times:
- if loop-value + {_base} > size of {_x::*}:
- set {_base} to size of {_x::*}
- set {_value} to {_base} + loop-value
- if {_base} is not {_baseDefault}:
- set {_value} to {_base} - loop-value
- 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%}:
- return false
- set {_base} to {_baseDefault}
- if block at location 1 meters above {_loc} is top westward red brick stair:
- set {_current} to 1
- loop 4 times:
- 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}
- if block at {_check} is not {_layer2::%loop-value%}:
- return false
- else if "%block at {_check}%" starts with "top":
- return false
- add 2 to {_current}
- if block at location 2 meters above {_loc} is not red brick block:
- return false
- else:
- return false
- else:
- return false
- return true
- on rightclick on smooth stone:
- if player is not sneaking:
- if {anvil.%location of clicked block%} is true:
- gui(player)
- cancel event
- on rightclick on cauldron:
- if {furnace.%location of event-block%} is true:
- if isFurnace1(location 1 meters below clicked block):
- cancel event
- send "WIP"
- else:
- delete {furnace.%location of event-block%}
- on rightclick on blast furnace:
- if {furnace2.%location of event-block%} is true:
- if isFurnace2(location of clicked block):
- cancel event
- send "WIP"
- else:
- delete {furnace2.%location of event-block%}
- on rightclick holding stone axe:
- if clicked block is smooth stone or iron block or diamond block:
- if {anvil.%location of event-block%} is not true:
- set {anvil.%location of event-block%} to true
- set {_tier} to "Tier I"
- if clicked block is smooth stone:
- set {anvil.%location of event-block%.tier} to 1
- else if clicked block is iron block:
- set {anvil.%location of event-block%.tier} to 2
- set {_tier} to "Tier II"
- else:
- set {anvil.%location of event-block%.tier} to 3
- set {_tier} to "Tier III"
- set {_s} to 6
- loop all players in radius 6 around event-block:
- set {_v} to ({_s} - distance between loop-player and event-block)
- play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
- send "{@logo} Successfully created an anvil of %{_tier}%."
- summon armor stand at location 0.6 meters below event-block
- set name of last spawned armor stand to "&7Anvil"
- add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
- summon armor stand at location 0.9 meters below event-block
- set name of last spawned armor stand to "&7%{_tier}%"
- add "{Invisible:1b,NoGravity:1b,NoAI:1b,CustomNameVisible:1}" to NBT of last spawned armor stand
- else if clicked block is cauldron:
- if isFurnace1(location 1 meters below clicked block):
- set {furnace.%location of event-block%} to true
- else if clicked block is blast furnace:
- if isFurnace2(location of clicked block):
- set {furnace2.%location of event-block%} to true
- on break of smooth stone or iron block or diamond block:
- if {anvil.%location of event-block%} is true:
- set {_s} to 6
- loop all players in radius 6 around event-block:
- set {_v} to ({_s} - distance between loop-player and event-block)
- play sound "block.anvil.place" with volume {_v} and pitch 0 to loop-player
- delete {anvil.%location of event-block%}
- delete {anvil.%location of event-block%.tier}
- loop entities in radius 1 around event-block:
- if type of loop-entity is armor stand:
- kill loop-entity
- on inventory click:
- if type of clicked inventory is chest inventory:
- if inventory name of player's current inventory is "&8Anvil":
- cancel event
- command /stair:
- trigger:
- send "%block 1 meters below player%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement