Advanced APIs
Custom item behavior
Register an ItemBehaviorDefinition through PluginContext::items(). Behavior
callbacks can participate in the supported item-use boundaries while Bedriox
keeps inventory mutation and client synchronization authoritative.
Custom entities
Create a namespaced CustomEntityType, register a CustomMobDefinition, and
provide a fresh CustomMobBehavior from its factory. The definition selects the
vanilla presentation, category, dimensions, health, lifecycle behavior, and
optional persistent state codec.
$type = new CustomEntityType('myplugin:arena_guide');
$entities = $this->context()->entities();
$entities->register(new CustomMobDefinition(
$type,
new VanillaEntityIdentifier('minecraft:cow'),
EntityCategory::ANIMAL,
width: 0.9,
height: 1.4,
maximumHealth: 10.0,
factory: static fn(): CustomMobBehavior => new ArenaGuideBehavior(),
stateCodec: new ArenaGuideStateCodec(),
maximumStateBytes: ArenaGuideStateCodec::MAXIMUM_STATE_BYTES,
));
CustomMobBehavior separates spawn, ordinary tick, AI tick, and despawn work.
A bounded CustomMobStateCodec restores plugin-owned state after reload.
Blocks today
The current public API supports reading and changing canonical world blocks and
reacting to block break and placement events. It does not expose a custom
BlockBehavior registry yet. Do not depend on runtime internals to imitate one;
this guide will gain a dedicated section when that public contract exists.
