Crate Options

What is a Crate Option?

A crate option is one prize inside of a crate that a player can win. These are defined in the crate's config file (JSON). Each crate option is defined by a Json Object. Here is an excerpt showing the three types of crate options:

[
    {
      "name": "<gold>Master Ball",
      "item": {
        "id": "cobblemon:master_ball",
        "amount": 1
      },
      "weight": 33
    },
    {
      "name": "<green>$500",
      "item": "minecraft:emerald",
      "command": "eco deposit 500 dollars {player}",
      "weight": 33
    },
    {
      "name": "<dark_purple>Shiny Gengar",
      "pokemon": "gengar shiny=yes lvl=5",
      "weight": 34
    } 
]

This shows an Item Crate Option, a Master Ball, a Command Crate Option, $500 via Impactor, and a Pokemon Crate Option, a lvl 5 Shiny Gengar.

Weights here are set to add up to 100, but don't need to add up to 100. You can also not put the weight value at all, and the default of 1 will be set. If you had not set a weight in this example in any option, it'd still be a ⅓ chance of getting a specific option.

Item Crate Option

The key part of an Item Crate Option is the "item" Item Builder. This defines the item given to the player, and is also used in the Crate GUI for displays. You don't have to define the Item Builder as Json Object, you can just put a string containing an identifier like so:

The name value is also optional, if it's not present, the items name will be used. A key thing to keep in mind is that the name value is only used in GUIs - it doesn't affect the item given to the player. Whereas if you did this:

The item given to the player would be a Master Ball with gold name "Master Ball" - this'd stop it stacking with other Master Balls and annoys players.

If you use a lot of virtual/fake items, like BetterCrate keys, you'll want to use a Command Crate Option:

Command Crate Option

The most commonly used crate option, commands let you integrate Crates with a variety of 3rd party sidemods.

This Command Crate Option gives the player a BetterCrates key for a "Seasonal Coupon Pack". The "item" ItemBuilder is just used for display purposes, and the "name" field is set on top of it. In this example we set custom model data on a Popped Chorus Fruit, because we use custom model data to set a "Pokemon Pack" texture.

You can use more complicate commands to do things like giving out GuitarXPress's BottleCaps:

Pokemon Crate Option

The key part of a Pokemon Crate Option is obviously the "pokemon" field - which takes a Pokemon Properties string. This is the same format used in commands like /pokegive.

The most basic form of a Pokemon Crate Option is shown first, which just has three fields: the name, pokemon (properties), and the weight. You could even just have the "pokemon" field - the name will default to the Pokemon's name, and the weight will default to 1. Great if you just want to generate equal chance legendary crates to rake in the money.

By default, the "pokemon" field is used to create a Pokemon Item for displays. You can override that by defining an "item" Item Builder which also supports Pokemon Properties to make life easier. This way you can put lore text on the display.

Last updated