Skip to main content
Item methods are static methods on org.lodemc.api.LodeItemsApi. Every entry that gives an item has one: plain items, and the items that place blocks, props, crops and fluids, which share their entry’s id. A Lode Items stack is a normal vanilla item with extra components, so Bukkit sees its base Material (often PAPER). Use these methods to tell which custom item it is.

LodeItemsApi

Key
The Lode Items id of stack, or null for a vanilla stack, an empty stack or null. This is the fastest check: it only reads the stack.
boolean
Whether stack is any Lode Items item.
CustomItem
The item stack is, or null for a vanilla stack, or for a stack whose item was removed from the configs.
CustomItem
Item id, or null if there’s no such item. Also takes the id as a String.
Collection<CustomItem>
Every Lode Items item.
Set<Key>
The ids of every Lode Items item.
boolean
Whether id is a Lode Items item right now.
ItemStack
A new stack of item id, exactly as /lodeitems give makes it, or null if there’s no such item. amount is optional and defaults to 1. Also takes the id as a String.
ItemStack
stack rebuilt from its item’s current config, keeping what the player owns: damage, custom name, enchantments, dye, trims and other plugins’ data. This is what the item updater does when a player joins. Returns stack itself when it’s already current, vanilla, or its item has update: false. Use it on stacks you store yourself, such as in a database or a custom inventory.

CustomItem

An item as it’s configured. It’s read-only, and a reload makes new objects, so look items up again after LodeItemsLoadEvent.

Example: an item that reads its own settings

Owners can give any item settings for your plugin. Register the key in onLoad, then read it from the item’s entry:
items/tools/lucky_pickaxe.yml
See Config and assets for everything you can read from an entry.