Add Velocity (Entity Action Type)

Adds or sets velocity towards a specific direction.

Adds or sets velocity towards a specific direction.

Type ID: apoli:add_velocity

Fields

FieldTypeDefaultDescription
xFloat or Expression0.0The amount of velocity to add on the x-axis.
yFloat or Expression0.0The amount of velocity to add on the y-axis.
zFloat or Expression0.0The amount of velocity to add on the z-axis.
spaceSpace"world"Determines how the direction of the velocity to add/set will be calculated.
setBooleanfalseIf this is true, the action will act as a “set” velocity action, overriding the entity’s current velocity instead of adding to it.

Examples

"entity_action": {
    "type": "apoli:add_velocity",
    "y": 2
}

This example will add velocity to the entity’s positive Y axis, essentially launching the entity up in the air.

"entity_action": {
    "type": "apoli:add_velocity",
    "space": "local",
    "z": "health * 0.5"
}

This example launches the entity forward with a strength scaled by its current health — 10 blocks/tick of velocity at full health (20 × 0.5), less as it gets hurt. Expressions are evaluated against the entity the velocity is applied to; see Expression for the variable list.