Treasure Chests - iSach/UltraCosmetics GitHub Wiki

Treasure Chests!

For people who don't know what Treasure Chests are, it's a system similar to CS:GO cases. You get random things by buying a key and opening a Chest.

In version 2.0, Treasure Chests can work without the Ammo System or Vault. Below is more information about Treasure Chests, how to use them, and how to customize them.

How Do I Activate Treasure Chests?

In the configuration file, go to the Treasure Chests section and change Enabled: false to Enabled: true.
You must restart the server for the changes to take effect.

Loot

What loot options are available for Treasure Chests?

  • Money
  • Gadget Ammo
  • Gadgets
  • Mounts
  • Pets
  • Morphs
  • Suits
  • Hats
  • Particle Effects

You can change the chance of each loot, if a message should broadcast or not, and for some loot (e.g. ammo), you can specify a maximum amount can be earned. Under each cosmetic item further down in the configuration, you can choose whether it can be found in Treasure Chests or not (Can-Be-Found-In-Treasure-Chests).

Money Loot requires Vault and an economy plugin that supports Vault (such as iConomy or Essentials Economy). Ammo Loot requires the Ammo System to be enabled. More info about the Ammo System can be found on the Ammo System page.

If the requirements for one of the loot options isn't followed, it will simply be disabled. The rest will still work.

Opening a Chest

To open a chest, you can either click the Treasure Chest item in the main menu, or use the command /uc treasure <player> <x> <y> <z> <world> (requires the permission: ultracosmetics.command.treasure). In order to open a Treasure Chest, you'll need a free area of 5x5 around you.

Treasure Keys

You'll need a key to open a Treasure Chest. You can get a key by:

  • Opening the key purchase menu (/uc menu buykey).
  • Clicking the buy key item in the main menu.
  • Getting a key from the /uc give command (/uc give key <amount> <player>).

Customizing Treasure Chest Designs

You can customize Treasure Chests designs within the configuration file. Schematics aren't supported. At the bottom of the Treasure Chests section, you'll find a design section with templates. You can delete, add, and modify freely!

Here is an example of the designs section in the configuration file.

Designs:
  Classic:
    center-block: SEA_LANTERN
    around-center: OAK_PLANKS
    third-blocks: SPRUCE_PLANKS
    below-chests: OAK_LOG
    barriers: OAK_FENCE
    chest-type: NORMAL
    effect: FLAME
  • Material syntax is the "item ID" from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
  • chest-type can be NORMAL or ENDER.
  • effect is the particles that are played upon chest spawning. A list of options can be found at: http://pastebin.com/CVKkufck.
  • center-block is the block in the center of the design that the player stands on.
  • around-center are the blocks that are around the center-block.
  • third-blocks are the blocks around around-center.
  • below-chests are the blocks below the chests.
  • barriers are the walls/fences around the chest area.

Here is a diagram that shows most of the options. Treasure Chest Diagram

Giving Permissions

Permissions are given with a command. By default, it's the command to add permissions with LuckPerms. If you use a different plugin, change the command at the bottom of the Treasure Chest section labeled Permission-Add-Command.
Permission-Add-Command: lp user %name% permission set %permission% true [server] [world] (last two arguments are optional)

  • %name% is the player's username.
  • %permission% is the permission being added.

FAQ

Q: Can you do it like Mineplex?
A: No, but you can utilize the /uc treasure <player> <x> <y> <z> <world> command, which teleports the player to coords and opens a Treasure Chest for them.

Q: Can I add custom loot?
A: You can add custom loots that execute a command upon reception.

Q: The permission isn't being given.
A: You need to configure the permission command as explained above!

Q: I get a "Nothing" item.
A: It means you already have permission to everything, and that money and ammo loot are disabled.

Q: I get only money and/or ammo.
A: Same as above, but money and/or ammo loots are enabled.

⚠️ **GitHub.com Fallback** ⚠️