DAI 4.1 · STEP-BY-STEP
Reactions & Event-Driven Gameplay
Turn real gameplay events into deterministic server/client responses without wasteful tick polling.
What you are building
Primary path:
Turn real gameplay events into deterministic server/client responses without wasteful tick polling.
data/<namespace>/reactions/Turn real gameplay events into deterministic server/client responses without wasteful tick polling.
Step-by-step
- Choose a concrete eventDamage, use item, block interaction, first join, death, target acquired.
- Capture event contextIdentify actor/target/item/position before branching.
- Filter with conditionsDiscard irrelevant events early.
- Run server mutation firstDamage, score, inventory and world state belong to the server.
- Run client presentation secondOverlay/sound/animation can mirror the successful result.
- Test duplicate deliveryVerify the event cannot award or execute twice.
4.1 replaceable event hooks
reaction_events/*.json now binds logical event IDs to stable Java integration hooks. Built-in definitions are only fallbacks: datapacks can replace, disable, reprioritize or remap them.
{
"id":"my_pack:primary_attack",
"hook":"player_attack_input",
"enabled":true,
"priority":20,
"phases":["pre","during","post"],
"cancellable":true,
"overrideable":true
}Supported 4.1 hook fields are id, hook, enabled, priority, phases, cancellable, and overrideable.
Definition of done
- The feature still works after save/reload.
- Server state is authoritative; presentation mirrors it.
- Invalid input cannot duplicate rewards or bypass costs.
- Two players can use the system without sharing unintended temporary state.
- Any optional resource pack can be disabled without breaking datapack logic.
Next integration
Once this feature works alone, connect it to a complete loop instead of adding more isolated content. Use the complete-game tracks to see where it belongs in ACMS, Space Between Blocks, MineTrigger or Hollow Spiral.