Repository navigation
Game Events
Game Events are animation events designed to make animations react to gameplay conditions and entities.
Unlike visual events, which primarily affect rendering, Game Events can be used to introduce conditional or targeted behavior into an animation. They can also trigger other animation events, allowing complex behaviors to be built directly inside animation JSON.
Like every animation event, each entry uses the generic event wrapper:
type
side
start / process
params
This page focuses only on the Game Events available in this category and the parameters contained in params.
💡 Game Events are generally suitable for gameplay logic and can execute on both sides unless otherwise specified.
| Event | Description | Required Side |
|---|---|---|
| random_dice | Executes other events with a configurable random chance. | both |
| on_target_entity | Executes other events on one or more entities affected by the animation. The event triggered in the chain regarding this one will take the struck entity as its "owner" | both |
Targets the animation's current target.
"target_mode": "impacted_target"The events in do are executed on that target.
This is useful when the animation has a single relevant target.
Targets every entity currently affected by the animation.
"target_mode": "all_impacted_target"Each affected entity receives the events in do.
This is particularly useful for attacks that can hit multiple entities.
Selects one random entity from the entities currently affected by the animation.
"target_mode": "random_impacted_target"Only the selected entity receives the events in do.
The following example executes a command on the animation's current target:
"in_time_events": [
{
"type": "on_target_entity",
"side": "server",
"start": 0.0,
"params": {
"target_mode": "impacted_target",
"do": [
{
"type": "command_payload",
"params": {
"command": "say You were hit!"
}
}
]
}
}
]This example executes an event on every entity affected by the animation:
"in_time_events": [
{
"type": "on_target_entity",
"side": "server",
"start": 0.0,
"params": {
"target_mode": "all_impacted_target",
"do": [
{
"type": "command_payload",
"params": {
"command": "say Area attack!"
}
}
]
}
}
]If the animation affects three entities, the event is executed once for each of those entities.
This example selects one random entity from the entities affected by the animation:
"in_time_events": [
{
"type": "on_target_entity",
"side": "server",
"start": 0.0,
"params": {
"target_mode": "random_impacted_target",
"do": [
{
"type": "command_payload",
"params": {
"command": "say You were randomly selected!"
}
}
]
}
}
]If multiple entities were affected, only one of them is selected.
The do field accepts a list of event invocations, rather than a fixed event type.
This means that events inside do can themselves contain another do list.
For example:
random_dice
│
└── on_target_entity
│
└── another "do" or "then/otherwise"
│
└── any event
A chain can therefore combine multiple Game Events and other animation events.
💡 Everything is constrained by the event side: if the origin is "server," all events must be "server"... Otherwise, the flow will be cut off!
The following is a complete example:
{
"process": "on_begin",
"type": "random_dice",
"side": "server",
"params": {
"chance": 50,
"do": [
{
"type": "on_target_entity",
"params": {
"target_mode": "impacted_target",
"do": [
{
"type": "command_payload",
"params": {
"command": "say you lucky!"
}
}
]
}
}
]
}
}In this example:
-
random_diceperforms a 50% random check. - If successful,
on_target_entityselects the current target. -
command_payloadis then executed for that target.
💡 Advanced: The
dofield accepts event invocations recursively. This means an event can invoke another event, which can invoke another event, and so on. There is no need to think ofdoas being limited to only one level of nesting.
- Game Events are intended primarily for gameplay-related logic rather than visual effects.
- Both
random_diceandon_target_entitysupportbothsides. -
random_diceinterpretschanceas a percentage between0and100. -
on_target_entitydefaults toimpacted_targetwhentarget_modeis omitted. -
on_target_entityonly operates on entities currently available as targets of the animation. -
all_impacted_targetexecutes the nested events independently for every affected entity. -
random_impacted_targetselects only one affected entity. - The
dofield is optional for both events and defaults to an empty list. - Events inside
doare regular animation event invocations and can themselves contain nested events.
EF: Extended Datapacks
📦 Data
🧰 Core
👁️ Visuals
- Zoom Types
- Weapon Models per Style
- Advanced Swing Trails
- Weapons Passive Particles
- Shader Effects I
- Shader Effects II
- Shader Effects III
⚔️ Combat
🗝️ Skill Builder
🛠️ Innate Builder
- Simple Innate Skills
- Holdable Innate Skills
- Conditional Innate Skills
- Conditional Data Innate Skills
- Conditional Holdable Innate Skills
- Sequential Innate Skills
- Per Combo Innate Skills
- Combo Innate Skills
🗡️ Animation Operations
- Animation Operations
- Animation Properties
⚙️ Third-Party