Skip to content

Custom Items

Lord_Lofi edited this page Apr 18, 2026 · 2 revisions

Custom Items

LofiBox supports using items from custom item plugins as rewards. There are two ways to do this: HeadDatabase IDs (covered on the HeadDatabase Integration page) and base64 item data snapshots.


Base64 Item Data

LofiBox can store a complete binary snapshot of any ItemStack — including all PDC keys, NBT data, custom model data, and plugin-specific metadata — as a base64 string. This preserves full compatibility with:

  • MMOItems
  • Oraxen
  • Nexo
  • ItemsAdder
  • MythicMobs drops
  • ExecutableItems
  • Any plugin that stores data in PDC (PersistentDataContainer)

How to Capture an Item

Currently, item capture requires a short admin workflow:

  1. Hold the custom item in your hand.
  2. Run the following command in your server console or as an op:
/lofibox captureitem

Note: This command is planned for a future release. In the meantime, you can use a utility plugin or script to serialize the item to base64 using Paper's ItemStack.serializeAsBytes() API and paste the result into the YAML.

Using a Captured Item in YAML

Paste the base64 string as the item-data value. The material field is ignored when item-data is present.

rewards:
  mythic_sword:
    weight: 2
    display-name: "<red>⚔ Mythic Sword"
    item:
      item-data: "H4sIAAAAAAAA/+NBAAAA..."
      # material is ignored when item-data is present
    actions:
      - "[message] <red>You received the Mythic Sword!"

Standard Vanilla Items

For vanilla items, use the material field with any valid Bukkit material name:

item:
  material: DIAMOND_SWORD
  name: "<aqua>Sharp Sword"
  enchants:
    SHARPNESS: 5
    UNBREAKING: 3
  custom-model-data: 1001

Custom Model Data

Resource-pack items are supported via custom-model-data. Set it to the integer override used in your pack:

item:
  material: STICK
  name: "<gold>Magic Wand"
  custom-model-data: 1042

Priority Order

When building an item, LofiBox checks in this order:

  1. head-database-id — uses HeadDatabase if present and ready
  2. item-data — deserializes base64 snapshot
  3. material — standard Bukkit material (default: CHEST)

Any name, lore, custom-model-data, and enchants keys are applied on top of whichever base item was resolved.

Clone this wiki locally