Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- pref: &dCRATES &8•
- on right click on white shulker box:
- cancel event
- if player's held item is tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " ":
- cancel event
- set {_itemWon} to random element out of {crate.common::*}
- remove 1 of player's held item from player's inventory
- play "block_ender_chest_open" to player at volume 10 and pitch 1
- make event-block appear open for all players
- give {_itemWon} to player
- play "entity_ender_dragon_growl" to player at volume 10 and pitch 0
- wait 1 second
- make event-block appear closed for all players
- else:
- push the player upwards at speed 1
- push the player backwards at speed 1
- command /crate [<text>] [<text>] [<player>]:
- permission: crates.*
- trigger:
- if arg-1 is not set:
- send " "
- send "&d&l• &d/add <name> &8: &7&oCreates a new crate."
- send "&d&l• &d/crate add <name> &8: &7&oAdds held item to crate rewards."
- send "&d&l• &d/crate key <name> <player> &8: &7&oGives a crate key to a player."
- send "&d&l• &d/crate keyall <name> &8: &7&oGives everyone a crate key."
- send "&d&l• &d/crate delete <name> &8: &7&oDeletes a crate."
- send "&d&l• &d/crate list <name> &8: &7&oShows all items in the crate's rewards."
- send "&d&l• &d/crate clear <name> &8: &7&oClears all items from a crate's rewards."
- send " "
- if arg-1 is "add":
- if arg-2 is set:
- if arg-3 is not set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- add player's held item to {crate.%arg-2%::*}
- send "{@pref} &7You added your held item to the rewards for the &d%arg-2% &7crate!"
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is set:
- send "{@pref} &7/crate add <name>"
- else if arg-2 is not set:
- send "{@pref} &7/crate add <name>"
- if arg-1 is "key":
- if arg-2 is set:
- if arg-3 is set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- if arg-2 is "common":
- give arg-3 1 tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " "
- send "{@pref} &7You gave a &fCOMMON &7crate key to &d%arg-3%&d!" to player
- send "{@pref} &7You have been given a &fCOMMON &7crate key!" to arg-3
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is not set:
- send "{@pref} &7/crate key <name> <player>"
- else if arg-2 is not set:
- send "{@pref} &7/crate key <name> <player>"
- if arg-1 is "keyall":
- if arg-2 is set:
- if arg-3 is not set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- if arg-2 is "common":
- loop all players:
- give loop-player 1 tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " "
- send "{@pref} &7You gave everyone a &fCOMMON &7crate key." to player
- broadcast "{@pref} &7You have been given a &fCOMMON &7crate key."
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is set:
- send "{@pref} &7/crate keyall <name>"
- else if arg-2 is not set:
- send "{@pref} &7/crate keyall <name>"
- if arg-1 is "delete":
- if arg-2 is set:
- if arg-3 is not set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- delete {crate.%arg-2%::*}
- remove arg-2 from {crates::*}
- send "{@pref} &7Deleted &d%arg-2% &7crate!"
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is set:
- send "{@pref} &7/crate delete <name>"
- else if arg-2 is not set:
- send "{@pref} &7/crate delete <name>"
- if arg-1 is "list":
- if arg-2 is set:
- if arg-3 is not set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- open virtual chest inventory with size 3 named "&b%arg-2%&b's Rewards:" to player
- set {_n} to 0
- loop {crate.%arg-2%::*}:
- set {_i} to loop-value-2
- format gui slot {_n} of player with {_i} to close
- add 1 to {_n}
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is set:
- send "{@pref} &7/crate list <name>"
- else if arg-2 is not set:
- send "{@pref} &7/crate list <name>"
- if arg-1 is "clear":
- if arg-2 is set:
- if arg-3 is not set:
- loop {crates::*}:
- if {crates::*} contains arg-2:
- send "{@pref} &7Cleared items for &d%arg-2% &7crate!"
- delete {crate.%arg-2%::*}
- else if {crates::*} doesn't contain arg-2:
- send "{@pref} &7That crate doesn't exist!"
- else if arg-3 is set:
- send "{@pref} &7/crate clear <name>"
- else if arg-2 is not set:
- send "{@pref} &7/crate clear <name>"
- command /add [<text>]:
- permission: crates.*
- trigger:
- if arg-1 is not set:
- send "{@pref} &7/add <name>"
- else if arg-1 is set:
- loop {crates::*}:
- if {crates::*} contains arg-1:
- send "{@pref} &7That crate already exists!"
- else:
- add arg-1 to {crates::*}
- send "{@pref} &7You added &d%arg-1% &7to crates!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement