Add Velocity (Entity Action Type)
Adds velocity to the entity in a direction, or replaces its velocity with set.
Type ID: apoli:add_velocity
Fields
| Field | Type | Default | Description |
|---|---|---|---|
x | Float or Expression | 0.0 | Velocity to add on the X axis. |
y | Float or Expression | 0.0 | Velocity to add on the Y axis. |
z | Float or Expression | 0.0 | Velocity to add on the Z axis. |
space | Space | "world" | How the direction of the velocity is worked out. |
set | Boolean | false | With true, the velocity replaces the entity's current velocity instead of adding to it. |
Examples
"entity_action": {
"type": "apoli:add_velocity",
"y": 2
}This adds upward velocity, launching the entity into the air.
"entity_action": {
"type": "apoli:add_velocity",
"space": "local",
"z": "health * 0.5"
}This launches the entity forward with a strength that follows its current health: 10 blocks per tick at full health (20 × 0.5), and less as it gets hurt. Expressions are evaluated against the entity the velocity is applied to. See Expression for the variables.