Strategies
Every extension JAR provides a strategy class listed in its manifest. Strategies implement block or item behavior and receive a shared IgnisStrategyContext.
Class contract
Blocks extend AbstractIgnisBlockStrategy:
public class Strategy extends AbstractIgnisBlockStrategy {
public Strategy(IgnisStrategyContext context) {
super(context);
}
}
Items extend AbstractIgnisItemStrategy instead.
IgnisStrategyContext
The context exposes:
| Service | Purpose |
|---|---|
| Scheduler | Async and sync tasks |
| NBT service | Read/write NBT on items and entities |
| Protocol service | Packet-level hooks when available |
| Effect service | Particles and sounds |
| ExtensionSupport | Inventories, drop collectors, world bridge |
Strategy profiles
YAML behavior sections merge into the strategy profile at runtime. The core routes standard click actions before calling strategy overrides.
Override onPlacedClick (blocks) or onItemUse (items) only when you need logic beyond declared behavior tokens.
Registry
Manifest id values register in IgnisStrategyRegistry. Config id values map to in-game types via BlockManager and ItemManager.
Related
- Block lifecycle — placed vs active callbacks
- Item lifecycle —
IgnisInteractionbranching - API Reference — strategy interfaces
- Javadoc