Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on right click on chest:
- if event-block is south facing chest:
- set {_facing} to south
- else if event-block is north facing chest:
- set {_facing} to north
- else if event-block is east facing chest:
- set {_facing} to east
- else if event-block is west facing chest:
- set {_facing} to west
- cancel event
- set {_d} to location of event-block
- set {_d} to rounded {_d}
- create new gui with id "crate" with virtual chest named " &8>=&b&lCRATES&8=<" with 5 rows
- open gui with id "crate" to player
- loop all integers between 0 and 21:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 22 and 23:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 25 and 25:
- format gui slot loop-value-2 of player with gray glass panes named ""
- loop all integers between 27 and 58:
- format gui slot loop-value-2 of player with gray glass panes named ""
- set {_t} to x coordinate of event-block
- set {_d} to y coordinate of event-block
- set {_g} to z coordinate of event-block
- set {_nochange} to location of event-block
- set {_nochange} to rounded {_nochange}
- set {_p} to player
- format gui slot 20 of player with chest named "&aRookie Crate &8(%{crates::rookie::%player's uuid%}%)" to close:
- if {crates::rookie::%player's uuid%} is more than 0:
- add 1 to {_d}
- if {_facing} is south:
- add 1.5 to {_t}
- set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o} to last spawned entity
- whileAlive({_o})
- subtract 3 from {_t}
- add 0.5 to {_g}
- set {_h} to location({_t}, {_d}, {_g}, world "world")
- summon a armor stand at {_h}
- add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
- set {_o2} to last spawned entity
- whileAlive({_o2})
- loop 7 times:
- push {_o} down with force 0.16
- push {_o} west with force 0.0068
- push {_o2} down with force 0.16
- push {_o2} east with force 0.0068
- wait 1 tick
- play chest open animation at block at {_nochange} for all players
- wait 1.5 seconds
- kill {_o}
- kill {_o2}
- wait 3.5 seconds
- play chest close animation at block at {_nochange} for all players
- else:
- send "You do not have a key for this crate"
- format gui slot 22 of player with chest named "&aAncient Crate &8(%{crates::ancient::%player's uuid%}%)" to close:
- if {crates::rookie::%player's uuid%} is more than 0:
- play chest open animation at block at {_nochange} for all players
- wait 10 seconds
- play chest close animation at block at {_nochange} for all players
- else:
- send "You do not have a key for this crate"
- format gui slot 24 of player with chest named "&aMythical Crate &8(%{crates::mythical::%player's uuid%}%)" to close:
- if {crates::rookie::%player's uuid%} is more than 0:
- play chest open animation at block at {_nochange} for all players
- wait 10 seconds
- play chest close animation at block at {_nochange} for all players
- else:
- send "You do not have a key for this crate"
- command /bye:
- trigger:
- loop all entities in a radius of 5 around player:
- if loop-entity is a armor stand:
- kill loop-entity
- on left click on chest:
- cancel event
- play chest open animation at event-block for player
- wait 10 seconds
- play chest close animation at event-block for player
- command /setcrates <player> <text> <integer>:
- permission: set.crates
- trigger:
- set {crates::%arg 2%::%arg-1's uuid%} to arg 3
- on join:
- if {crates::rookie::%player's uuid%} is not set:
- set {crates::rookie::%player's uuid%} to 0
- if {crates::ancient::%player's uuid%} is not set:
- set {crates::ancient::%player's uuid%} to 0
- if {crates::mythical::%player's uuid%} is not set:
- set {crates::mythical::%player's uuid%} to 0
- command /itemset <text> <
- function whileAlive(E: entity):
- while {_E} is alive:
- set {_V} to velocity of {_E}
- set velocity of {_E} to vector(x of {_V}, 0, z of {_V})
- wait 1 tick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement