Skip to main content

Item Lifecycle

Custom items are standard inventory items tagged with IgnisCore NBT. Behavior is driven by YAML behavior and strategy code.

Config sections

SectionPurpose
displayTitle and description
itemBase material and item flags
texturesIcon asset path
behaviorClick actions (assign, throw, detonate, etc.)
custom_dataExtension-specific tuning

Item behavior

behavior:
left_click_block: assign
right_click_air: detonate
right_click_block: detonate

Action tokens are interpreted by the item strategy (throw, assign, detonate, etc.).

Strategy hook

Items use a single hook — branch on IgnisInteraction in strategy code:

@Override
public void onItemUse(IgnisPlayer player, ItemDefinition definition, IgnisItem item,
IgnisInteraction action, IgnisBlock clickedBlock) {
switch (action) {
case RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK -> throwItem(player, definition, item);
default -> { }
}
}

Typed config

Use extensions/shared helpers for common patterns:

ThrowableItemConfig throwable = ExtensionConfigs.throwable(definition);
double speed = throwable.throwVelocity();
int fuseTicks = throwable.fuseTicks();