Skip to content

Creating Boxes

Lord_Lofi edited this page Apr 18, 2026 · 3 revisions

Creating Boxes

Each .yml file inside plugins/LofiBox/boxes/ defines one mystery box. The filename (without .yml) becomes the box's ID.

For example, plugins/LofiBox/boxes/mythic.yml creates a box with ID mythic.


Full Box Structure

# Display name shown in the spin GUI title and messages. Supports MiniMessage.
name: "<gradient:#a78bfa:#6366f1>Mythic Crate</gradient>"

# The physical item players carry and right-click to open.
item:
  material: CHEST
  name: "<gradient:#a78bfa:#6366f1>✦ Mythic Crate ✦</gradient>"
  lore:
    - ""
    - "<gray>Right-click to open!"
    - ""
    - "<dark_gray>mythic crate"
  custom-model-data: 0
  # Uncomment to use a HeadDatabase head as the box item:
  # head-database-id: "3337"

# Sounds (optional — falls back to config.yml defaults)
sounds:
  open: "block.chest.open"
  win: "entity.player.levelup"

# Reward definitions — see the Rewards & Actions page for full reward syntax.
rewards:
  my_reward:
    weight: 10
    display-name: "<aqua>My Reward"
    item:
      material: DIAMOND
    actions:
      - "[message] <aqua>You won a diamond!"

Box Item Options

The item: section under the root of the box file defines what the box looks like as a holdable item.

Key Required Description
material Yes (if no HDB) Bukkit material name, e.g. CHEST, ENDER_CHEST
name No MiniMessage display name
lore No List of MiniMessage lore lines
custom-model-data No Integer for resource-pack model overrides
head-database-id No HeadDatabase ID — overrides material
item-data No Base64 serialized item — for complex custom plugin items

Sound Names

Sounds follow the Bukkit Sound enum format. Dots are converted to underscores automatically, so both block.chest.open and BLOCK_CHEST_OPEN work.

Common values:

Sound Effect
block.chest.open Chest opening sound
entity.player.levelup Level-up jingle
ui.toast.challenge_complete Achievement sound
entity.ender_dragon.growl Dragon roar
block.amethyst_block.chime Crystal chime

Naming & Reloading

  • The box ID is derived from the filename — rename the file to change the ID.
  • Run /lofibox reload after adding or editing boxes.
  • Box IDs are case-sensitive.

Example: Three-Tier Crate Setup

plugins/LofiBox/boxes/
├── common.yml      # ID: common
├── rare.yml        # ID: rare
└── legendary.yml   # ID: legendary

Give a rare crate to a player:

/lofibox give rare Steve 1

Clone this wiki locally