-
Notifications
You must be signed in to change notification settings - Fork 0
Event Layer
Maksym Uimanov edited this page Jan 30, 2026
·
2 revisions
The Event Layer is responsible for activating event handling logic defined by the mod.
While previous layers:
- prepare objects (Initialization),
- register content (Registry),
- interpret metadata (Metadata),
- expose configuration (Config),
the Event Layer answers:
“What runtime behavior should react to events?”
This layer is where event subscriptions actually become live.
The Event Layer:
- Collects all registered
EventHandlerinstances - Executes their
handle()method - Allows handlers to subscribe to NeoForge and mod event buses
- Obtain the global HandlerPool
- Iterate over all registered EventHandler instances
- Call handle() on each handler
- EventHandlers are passive until this layer runs.
public class EventLayerBuilderThe builder:
- Adds the EventLayer to the engine
- Immediately processes it when
.and()is called
this.engineBuilder.processLayer(eventLayer);This guarantees that all event handlers are activated during engine startup.
public interface EventHandlerAn EventHandler is a self-contained event wiring unit.
Its responsibility is to:
- Subscribe to events
- Define reactions
- Decide priorities
- All logic is executed inside
handle().
subscribeEvent(Class<T> event, EventAdapter<T, ?> adapter)This allows:
- Separation of event and logic mapping
- Reusable adapters
- Cleaner handlers
InjectionPool.getFromInstance(IEventBus.class)The Event Layer depends on:
SimpleHandlerPool.getInstance()This implies:
- Handlers are discovered and registered earlier
- Likely during Initialization or Metadata processing
- Event Layer only executes, never discovers
The Event Layer:
- Activates all registered EventHandler instances
- Executes event wiring logic
- Connects Temporal API to NeoForge’s event system
- Marks the transition from setup to runtime behavior
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples