on right click with ender chest:
name of player's tool is "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-":
if player can hold 768 command block:
open chest with 6 rows named "&lIROTHAI CAVERNS LOOTBOX" to player
wait 1 tick
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
remove 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" from player's inventory
play sound "block.ender_chest.open" with volume 100 and pitch 0.75 at player for player
play sound "entity.firework_rocket.launch" with volume 100 and pitch 1 at player for player
play sound "entity.player.levelup" with volume 100 and pitch 1 at player for player
loop integers between 0 and menu size of player's current inventory - 1:
set slot loop-number of player's current inventory to black stained glass pane named " "
loop integers between 12 and 15 - 1:
set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
loop integers between 21 and 24 - 1:
set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
loop integers between 30 and 33 - 1:
set slot loop-number of player's current inventory to ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!"
set slot 49 of player's current inventory to red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!"
stop
else:
play sound "entity.villager.no" with volume 100 and pitch 1 at player for player
send "&4&l(!) &4You do not have enough room in your"
send "&4inventory to open this crate!"
send "&e&l(!) &eRequired Space:&7 12 slots or more"
on inventory click:
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
cancel the event
clicked slot is 12, 13, 14, 21, 22, 23, 30, 31 or 32:
set {slot::%player%::%event-slot%} to clicked slot
if slot {slot::%player%::%event-slot%} of player's current inventory is ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
delete {rolltime::%player%::%event-slot%}
loop 50 times:
if {rolltime::%player%::%event-slot%} is not set:
set {rolltime::%player%::%event-slot%} to 0
add 0.005 to {rolltime::%player%::%event-slot%}
wait "%{rolltime::%player%::%event-slot%}% seconds" parsed as timespan
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
play sound "block.dispenser.dispense" with volume 100 and pitch 1 at player for player
chance of 100%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 64 experience bottle named "&7x256 Bottles of Enchanting" with lore "&f* NORMAL *"
chance of 40%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 2 golden apple named "&7x64 Golden Apples" with lore "&f* NORMAL *"
chance of 25%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 32 diamond block named "&7x32 Diamond Blocks" with lore "&f* NORMAL *"
chance of 20.50%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 2 beacon named "&7x2 Beacons" with lore "&f* NORMAL *"
chance of 13.50%:
set slot {slot::%player%::%event-slot%} of player's current inventory to diamond pickaxe of efficiency 6, unbreaking 10 and fortune 4 named "&7x1 Irothian Pickaxe" with lore "&f* NORMAL *"
chance of 10%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 2 enchanted golden apple named "&5x2 Enchanted Golden Apples" with lore "&5* EPIC *"
chance of 7.65%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 3 book named "&5x3 Random Custom Enchants" with lore "&5* EPIC *"
chance of 5.50%:
set slot {slot::%player%::%event-slot%} of player's current inventory to shulker box named "&5x1 Shulker Box" with lore "&5* EPIC *"
chance of 4.75%:
set slot {slot::%player%::%event-slot%} of player's current inventory to enchanted book named "&5x1 Mending Enchanted Book" with lore "&5* EPIC *"
chance of 4.50%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 3 chest named "&5x3 Random Loot Crates &7(Tier 1 - 3)" with lore "&5* EPIC *"
chance of 3.5%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 5 book named "&ex5 Random Custom Enchants" with lore "&6* Legendary *"
chance of 3.5%:
set slot {slot::%player%::%event-slot%} of player's current inventory to paper named "&ex1 Command Access" with lore "&7/sethome, /home" and "&6* Legendary *"
chance of 2.5%:
set slot {slot::%player%::%event-slot%} of player's current inventory to elytra named "&ex1 Elytra" with lore "&6* Legendary *"
chance of 2.5%:
set slot {slot::%player%::%event-slot%} of player's current inventory to dragon egg named "&ex1 Dragon Egg" with lore "&6* Legendary *"
chance of 2.25%:
set slot {slot::%player%::%event-slot%} of player's current inventory to 3 chest named "&ex3 Random Loot Crates &7(Tier 2 - 4)" with lore "&6* Legendary *"
chance of 2%:
set slot {slot::%player%::%event-slot%} of player's current inventory to experience bottle named "&ex1 Experience Booster &7(4 Hours)" with lore "&6* Legendary *"
set {reward::%player%::%event-slot%} to {slot::%player%::%event-slot%}
loop all items in player's current inventory:
slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory is not ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
stop
clicked slot is 49:
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
slot 49 of player's current inventory is glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
play sound "entity.bat.takeoff" with volume 100 and pitch 0.75 at player for player
chance of 2.5%:
set slot 49 of player's current inventory to glowing blaze powder named "&cx1 &k::&7&l Irothian Knight VKit Access &c&k::" with lore "&4* Divine *"
stop
chance of 2.5%:
set slot 49 of player's current inventory to glowing tripwire hook named "&cx1 &k::&7&l Irothai Caverns Key &c&k::" with lore "&4* Divine *"
stop
chance of 5%:
set slot 49 of player's current inventory to glowing water bottle named "&cx1 Potion of Unlimited Buffs &7(3 Uses)" with lore "&4* Divine *"
stop
chance of 5%:
set slot 49 of player's current inventory to book named "&cx1 Random Divine Custom Enchant" with lore "&4* Divine *"
stop
chance of 5.5%:
set slot 49 of player's current inventory to armor stand named "&cx1 Irothian Knight Figurine" with lore "&4* Divine *"
stop
chance of 7.5%:
set slot 49 of player's current inventory to 2 totem of undying named "&cx2 Totems of Undying" with lore "&4* Divine *"
stop
chance of 50%:
set slot 49 of player's current inventory to experience bottle named "&ex1 Experience Booster &7(4 Hours)" with lore "&6* Legendary *"
stop
chance of 50.25%:
set slot 49 of player's current inventory to 3 chest named "&ex3 Random Loot Crates &7(Tier 2 - 4)" with lore "&6* Legendary *"
stop
chance of 50.5%:
set slot 49 of player's current inventory to dragon egg named "&ex1 Dragon Egg" with lore "&6* Legendary *"
stop
chance of 50.5%:
set slot 49 of player's current inventory to elytra named "&ex1 Elytra" with lore "&6* Legendary *"
stop
chance of 60%:
set slot 49 of player's current inventory to paper named "&ex1 Command Access" with lore "&7/sethome, /home" and "&6* Legendary *"
stop
chance of 100%:
set slot 49 of player's current inventory to 5 book named "&ex5 Random Custom Enchants" with lore "&6* Legendary *"
stop
on inventory close:
name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
loop all items in player's current inventory:
slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory is ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
wait 1 tick
give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
stop
slot 49 of player's current inventory is red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
wait 1 tick
open event-inventory to player
stop
slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
slot 49 of player's current inventory is glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
wait 1 tick
open event-inventory to player
stop
slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
slot 49 of player's current inventory is not glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
give {reward::%player%::12} to player
give {reward::%player%::13} to player
give {reward::%player%::14} to player
give {reward::%player%::21} to player
give {reward::%player%::22} to player
give {reward::%player%::23} to player
give {reward::%player%::30} to player
give {reward::%player%::31} to player
give {reward::%player%::32} to player
give {reward::%player%::49} to player
stop