Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.
#Crates
on leftclick on chest:
if {raretchest.%clicked block%} = true:
set {lookingatchest.%player%} to true
cancel event
open inventory of clicked block to player
if {commontchest.%clicked block%} = true:
set {lookingatchest.%player%} to true
cancel event
open inventory of clicked block to player
if {mythictchest.%clicked block%} = true:
set {lookingatchest.%player%} to true
cancel event
open inventory of clicked block to player
if {artifacttchest.%clicked block%} = true:
set {lookingatchest.%player%} to true
cancel event
open inventory of clicked block to player
if {zwartifacttchest.%clicked block%} = true:
set {lookingatchest.%player%} to true
cancel event
open inventory of clicked block to player
on inventory click:
if {lookingatchest.%player%} = true:
cancel event
on inventory close:
set {lookingatchest.%player%} to false
command putstuffinchest:
trigger:
if player has permission "lootcrates.admin":
if {settingachest.%player%} is true:
set {settingachest.%player%} to false
send "&bYou can now use the chest like a player would." to player
stop
if {settingachest.%player%} is false:
set {settingachest.%player%} to true
send "&bYou can now put stuff in the chest to change it out." to player
stop
on rightclick on chest:
if {commontchest.%clicked block%} = true:
cancel event
if name of held item is "&9[Common Key]":
set {_tool} to tool of player
chance of 50%:
set {_slot} to a random integer from 0 to 8
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&9[Common] &b%name of player% &aopened a Common Chest and received %{_slotname}%&a!"
stop
chance of 35%:
set {_slot} to a random integer from 9 to 17
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&9[Common] &b%name of player% &aopened a Common Chest and received %{_slotname}%&a!"
stop
set {_slot} to a random integer from 18 to 26
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&9[Common] &b%name of player% &aopened a Common Chest and received %{_slotname}%&a!"
stop
if {raretchest.%clicked block%} = true:
cancel event
if name of held item is "&2[Rare Key]":
set {_tool} to tool of player
chance of 50%:
set {_slot} to a random integer from 0 to 8
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&2[Rare] &b%name of player% &aopened a Rare Chest and received %{_slotname}%&a!"
stop
chance of 35%:
set {_slot} to a random integer from 9 to 17
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&2[Rare] &b%name of player% &aopened a Rare Chest and received %{_slotname}%&a!"
stop
set {_slot} to a random integer from 18 to 26
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&2[Rare] &b%name of player% &aopened a Rare Chest and received %{_slotname}%&a!"
stop
if {mythictchest.%clicked block%} = true:
cancel event
if name of held item is "&5[Mythic Key]":
set {_tool} to tool of player
chance of 50%:
set {_slot} to a random integer from 0 to 8
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&5[Mythic] &b%name of player% &aopened a Mythic Chest and received %{_slotname}%&a!"
stop
chance of 35%:
set {_slot} to a random integer from 9 to 17
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&5[Mythic] &b%name of player% &aopened a Mythic Chest and received %{_slotname}%&a!"
stop
set {_slot} to a random integer from 18 to 26
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&5[Mythic] &b%name of player% &aopened a Mythic Chest and received %{_slotname}%&a!"
stop
if {artifacttchest.%clicked block%} = true:
cancel event
if name of held item is "&6[Artifact Key]":
set {_tool} to tool of player
chance of 50%:
set {_slot} to a random integer from 0 to 8
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&6[Artifact] &b%name of player% &aopened an Artifact Chest and received %{_slotname}%&a!"
stop
chance of 35%:
set {_slot} to a random integer from 9 to 17
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&6[Artifact] &b%name of player% &aopened an Artifact Chest and received %{_slotname}%&a!"
stop
set {_slot} to a random integer from 18 to 26
set {_slotname} to name of slot {_slot} of inventory of event-block
give player slot {_slot} of inventory of event-block
remove 1 of {_tool} from player's inventory
broadcast "&6[Artifact] &b%name of player% &aopened an Artifact Chest and received %{_slotname}%&a!"
stop
else:
send "&cYou need a key." to player
stop
if {zwartifacttchest.%clicked block%} = true:
cancel event
stop
command settchest <text>:
trigger:
if player has permission "lootcrates.admin":
if target block is not a chest:
send "&cThis is not a chest." to player
stop
arg-1 is "rare":
set {raretchest.%target block%} to true
send "&bRare Chest Set at %location of target block%" to player
stop
arg-1 is "common":
set {commontchest.%target block%} to true
send "&bCommon Chest Set at %location of target block%" to player
stop
arg-1 is "mythic":
set {mythictchest.%target block%} to true
send "&bMythic Chest Set at %location of target block%" to player
stop
arg-1 is "artifact":
set {artifacttchest.%target block%} to true
send "&bArtifact Chest Set at %location of target block%" to player
stop
arg-1 is "zwartifact":
set {zwartifacttchest.%target block%} to true
send "&bZW Artifact Chest Set at %location of target block%" to player
stop
command removetchest:
trigger:
if player has permission "lootcrates.admin":
if {raretchest.%target block%} = true:
clear {raretchest.%target block%}
send "&bCleared Rare Chest location." to player
stop
if {commontchest.%target block%} = true:
clear {commontchest.%target block%}
send "&bCleared Common Chest location." to player
stop
if {mythictchest.%target block%} = true:
clear {mythictchest.%target block%}
send "&bCleared Mythic Chest location." to player
stop
if {artifacttchest.%target block%} = true:
clear {artifacttchest.%target block%}
send "&bCleared Artifact Chest location." to player
stop
if {zwartifacttchest.%target block%} = true:
clear {zwartifacttchest.%target block%}
send "&bCleared Artifact Chest location." to player
stop
command crate <text> <player> <text> <number>:
trigger:
if player has permission "lootcrates.admin":
arg-1 is "give":
arg-3 is "common":
loop arg-4 times:
set {_ice} to tripwire hook named "&9[Common Key]" with lore "&eUse this key to unlock a Common chest||&aJust &6Right Click &aa Common Chest to open it."
enchant {_ice} with unbreaking 10
give arg-2 {_ice}
stop
arg-3 is "rare":
loop arg-4 times:
set {_ice} to tripwire hook named "&2[Rare Key]" with lore "&eUse this key to unlock a Rare chest||&aJust &6Right Click &aa Rare Chest to open it."
enchant {_ice} with unbreaking 10
give arg-2 {_ice}
stop
arg-3 is "mythic":
loop arg-4 times:
set {_ice} to tripwire hook named "&5[Mythic Key]" with lore "&eUse this key to unlock a Mythic chest||&aJust &6Right Click &aa Mythic Chest to open it."
enchant {_ice} with unbreaking 10
give arg-2 {_ice}
stop
arg-3 is "artifact":
loop arg-4 times:
set {_ice} to tripwire hook named "&6[Artifact Key]" with lore "&eUse this key to unlock an Artifact chest||&aJust &6Right Click &aan Artifact Chest to open it."
enchant {_ice} with unbreaking 10
give arg-2 {_ice}
stop
command fixme:#Run first when playing with this to get the variable set
trigger:
if player has permission "lootcrates.admin":
set {settingachest.%player%} to false