Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &8[&c&lMegaCrates&8]&e
- key-item: tripwire hook
- crate-block: ender chest
- animation: true
- animation-length: 8
- # animation-length specifies length of animation IN SECONDS
- no-key-explosion: false
- # doesn't push player back so hard if he doesn't have key and this is false
- open-messages: true
- # here you can set which items will be in opening animation as border
- animation-item1: red stained glass pane
- animation-item2: yellow stained glass pane
- animation-item3: green stained glass pane
- command /megacrates [<text>] [<text>] [<player>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- command /megacrate [<text>] [<text>] [<player>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- command /crates [<text>] [<text>] [<player>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- command /crate [<text>] [<text>] [<player>]:
- trigger:
- if arg 1 isn't set:
- message " &2>> {@prefix} &a&lv1.3"
- message " "
- message "&b/crate give <name> <player> &eGives crate key to specified player."
- message "&b/crate create <name> &eCreates new crate with specified name."
- message "&b/crate additem <name> &eAdds item that you're holding to specified crate."
- message "&b/crate removeitem <name> &eRemoves last item that has been added into crate."
- message "&b/crate place <name> &ePlaces crate to place you're looking at."
- message "&b/crate delete <name> &eDeletes specified crate."
- message " "
- message " &cCreated by PiskotPiskotovic"
- else if arg 1 is "give":
- if player has permission "megacrates.give":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- if arg 3 is set:
- message " {@prefix} &eYou've given &c&l%arg 2% &ckey&e to &a%arg 3%!&e"
- give 1 {@key-item} named "&c&l%arg 2% key" to arg 3
- else:
- message " {@prefix} &cYou didn't specify any player!"
- else:
- message " {@prefix} &cThat crate doesn't exist."
- else:
- message "{@prefix} &cYou didn't specify crate name!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission."
- else if arg 1 is "create":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} isn't set:
- message " {@prefix} &eCrate named &a%arg 2% &ehas been set!"
- set {Crate.%arg 2%} to true
- else:
- message " {@prefix} &cCrate with that name already exists!"
- else:
- message " {@prefix} &cYou didn't specify crate name!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission."
- else if arg 1 is "additem":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- if player's tool isn't air:
- message " {@prefix} &eYou've successfully added new item to crate &a%arg 2%&e!"
- add 1 to {CrateItemsTotal.%arg 2%}
- set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%" parsed as item
- else:
- message " {@prefix} &cYou can't add air to things players can win..."
- else:
- message " {@prefix} &cThat crate doesn't exist!"
- else:
- message " {@prefix} &cYou didn't specify crate name!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission!"
- else if arg 1 is "place":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- set player's target block to {@crate-block}
- message " {@prefix} &eCrate was successfully set!"
- set {CrateLocation.%player's target block's location%} to "%arg 2%"
- else:
- message " {@prefix} &cThat crate doesn't exist!"
- else:
- message " {@prefix} &cYou didn't specify any crate!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission!"
- else if arg 1 is "delete":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- delete {CrateItem.%arg 2%}
- delete {Crate.%arg 2%}
- delete {CrateItemsTotal.%arg 2%}
- message " {@prefix} &eCrate &a%arg 2% &ewas successfully deleted!"
- else:
- message " {@prefix} &cThis crate doesn't exist!"
- else:
- message " {@prefix} &cYou didn't specify any crate!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission!"
- else if arg 1 is "removeitem":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- message " {@prefix} &eYou've successfully removed %{CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%}% from crate %arg 2%!"
- remove {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} from {CrateItem.%arg 2%::*}
- remove 1 from {CrateItemsTotal.%arg 2%}
- else:
- message " {@prefix} &cThat crate doesn't exist."
- else:
- message " {@prefix} &cYou didn't specify any crate!"
- else:
- message " {@prefix} &cIt looks like that you don't have permission!"
- else:
- message " {@prefix} &cCommand not found. /crate"
- on load:
- set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
- if {update} isn't "1.3":
- message " {@prefix} &eNew version is available!" to console
- message " &aDownload: &ehttp://bit.ly/1r3ykw2" to console
- on join:
- if player has permission "megacrates.admin":
- set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
- if {update} isn't "1.3":
- message " {@prefix} &eNew version is available!"
- message " &aDownload: &ehttp://bit.ly/1r3ykw2"
- on rightclick on {@crate-block}:
- if {CrateLocation.%block's location%} is set:
- cancel event
- if player's tool is {@key-item} named "&c&l%{CrateLocation.%block's location%}% key":
- remove {@key-item} named "&c&l%{CrateLocation.%block's location%}% key" from player's inventory
- if {@animation} is false:
- loop 5 times:
- wait 0.1 second
- play mob spawner flames at target block
- play raw sound "note.bass" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.bassattack" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.harp" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.pling" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.snare" at player with pitch 5 volume 10
- set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- give {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to player
- if {@open-messages} is true:
- broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%block's location%}%::%{random}%}%&e!"
- else:
- stop
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- delete {random}
- else if {@animation} is true:
- open chest with 3 rows named "{@prefix}" to player
- cancel event
- if inventory name of player's current inventory is "{@prefix}":
- loop {@animation-length} times:
- play raw sound "note.pling" at player with pitch 1 volume 10
- format slot 0 of player with {@animation-item1} to be unstealable
- format slot 1 of player with {@animation-item1} to be unstealable
- format slot 2 of player with {@animation-item1} to be unstealable
- format slot 3 of player with {@animation-item1} to be unstealable
- format slot 4 of player with {@animation-item1} to be unstealable
- format slot 5 of player with {@animation-item1} to be unstealable
- format slot 6 of player with {@animation-item1} to be unstealable
- format slot 7 of player with {@animation-item1} to be unstealable
- format slot 8 of player with {@animation-item1} to be unstealable
- format slot 9 of player with {@animation-item1} to be unstealable
- format slot 10 of player with {@animation-item1} to be unstealable
- format slot 11 of player with {@animation-item1} to be unstealable
- format slot 12 of player with {@animation-item1} to be unstealable
- set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize}%} to be unstealable
- format slot 14 of player with {@animation-item1} to be unstealable
- format slot 15 of player with {@animation-item1} to be unstealable
- format slot 16 of player with {@animation-item1} to be unstealable
- format slot 17 of player with {@animation-item1} to be unstealable
- format slot 18 of player with {@animation-item1} to be unstealable
- format slot 19 of player with {@animation-item1} to be unstealable
- format slot 20 of player with {@animation-item1} to be unstealable
- format slot 21 of player with {@animation-item1} to be unstealable
- format slot 22 of player with {@animation-item1} to be unstealable
- format slot 23 of player with {@animation-item1} to be unstealable
- format slot 24 of player with {@animation-item1} to be unstealable
- format slot 25 of player with {@animation-item1} to be unstealable
- format slot 26 of player with {@animation-item1} to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.4 seconds
- format slot 0 of player with {@animation-item2} to be unstealable
- format slot 1 of player with {@animation-item2} to be unstealable
- format slot 2 of player with {@animation-item2} to be unstealable
- format slot 3 of player with {@animation-item2} to be unstealable
- format slot 4 of player with {@animation-item2} to be unstealable
- format slot 5 of player with {@animation-item2} to be unstealable
- format slot 6 of player with {@animation-item2} to be unstealable
- format slot 7 of player with {@animation-item2} to be unstealable
- format slot 8 of player with {@animation-item2} to be unstealable
- format slot 9 of player with {@animation-item2} to be unstealable
- format slot 10 of player with {@animation-item2} to be unstealable
- format slot 11 of player with {@animation-item2} to be unstealable
- format slot 12 of player with {@animation-item2} to be unstealable
- set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize.%player%}%} to be unstealable
- format slot 14 of player with {@animation-item2} to be unstealable
- format slot 15 of player with {@animation-item2} to be unstealable
- format slot 16 of player with {@animation-item2} to be unstealable
- format slot 17 of player with {@animation-item2} to be unstealable
- format slot 18 of player with {@animation-item2} to be unstealable
- format slot 19 of player with {@animation-item2} to be unstealable
- format slot 20 of player with {@animation-item2} to be unstealable
- format slot 21 of player with {@animation-item2} to be unstealable
- format slot 22 of player with {@animation-item2} to be unstealable
- format slot 23 of player with {@animation-item2} to be unstealable
- format slot 24 of player with {@animation-item2} to be unstealable
- format slot 25 of player with {@animation-item2} to be unstealable
- format slot 26 of player with {@animation-item2} to be unstealable
- play raw sound "note.pling" at player with pitch 1 volume 10
- wait 0.3 second
- format slot 0 of player with {@animation-item3} to be unstealable
- format slot 1 of player with {@animation-item3} to be unstealable
- format slot 2 of player with {@animation-item3} to be unstealable
- format slot 3 of player with {@animation-item3} to be unstealable
- format slot 4 of player with {@animation-item3} to be unstealable
- format slot 5 of player with {@animation-item3} to be unstealable
- format slot 6 of player with {@animation-item3} to be unstealable
- format slot 7 of player with {@animation-item3} to be unstealable
- format slot 8 of player with {@animation-item3} to be unstealable
- format slot 9 of player with {@animation-item3} to be unstealable
- format slot 10 of player with {@animation-item3} to be unstealable
- format slot 11 of player with {@animation-item3} to be unstealable
- format slot 12 of player with {@animation-item3} to be unstealable
- set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize.%player%}%} to be unstealable
- format slot 14 of player with {@animation-item3} to be unstealable
- format slot 15 of player with {@animation-item3} to be unstealable
- format slot 16 of player with {@animation-item3} to be unstealable
- format slot 17 of player with {@animation-item3} to be unstealable
- format slot 18 of player with {@animation-item3} to be unstealable
- format slot 19 of player with {@animation-item3} to be unstealable
- format slot 20 of player with {@animation-item3} to be unstealable
- format slot 21 of player with {@animation-item3} to be unstealable
- format slot 22 of player with {@animation-item3} to be unstealable
- format slot 23 of player with {@animation-item3} to be unstealable
- format slot 24 of player with {@animation-item3} to be unstealable
- format slot 25 of player with {@animation-item3} to be unstealable
- format slot 26 of player with {@animation-item3} to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.3 second
- set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- give {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to player
- if {@open-messages} is true:
- broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%block's location%}%::%{random}%}%&e!"
- else:
- stop
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to close
- delete {random}
- else:
- message " {@prefix} &cYou don't have the right key!"
- if {@no-key-explosion} is true:
- push player backwards at speed 2
- play raw sound "random.explode" at player with pitch 5 volume 6
- else if {@no-key-explosion} is false:
- push player backwards at speed 0.9
- play raw sound "random.explode" at player with pitch 2 volume 3
- on leftclick on {@crate-block}:
- if {CrateLocation.%block's location%} is set:
- open chest with 3 rows named "{@prefix} &ePrizes" to player
- set {item} to 0
- set {times} to 0
- loop {CrateItemsTotal.%{CrateLocation.%block's location%}%} times:
- add 1 to {item}
- set {chance} to 100/{CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot {times} of player with {CrateItem.%{CrateLocation.%block's location%}%::%{item}%} named "&c%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}%" with lore "&eChance: &a%{chance}% %%" to close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement