Skip to content

Add Velocity

Adds velocity to an entity.

Type ID: kaya:add_velocity

Format

Field Type Default Description
method Method Determines the method of adding velocity to an entity.
velocity Vec3 Provider The velocity to add to the entity.

Method

A string that determines how velocity is applied to an entity. Each type has additional fields to further control how the velocity is applied.

Field Type Default Description
space Space "world" Determines how the velocity will be transformed.
entity Entity Provider The entity to add the velocity to.
Field Type Default Description
reference Reference "rotation" Determines the direction of the velocity is calculated from the two entities.
first Entity Provider The entity to use as a reference.
second Entity Provider The entity to add the velocity to.

Reference

A string that determines how the velocity will be transformed based on two entities.

Values

Value Description
position Use the positions of the first and second entities to transform the velocity.
rotation Use the rotation of the first entity to transform the velocity.

Example

{
    "type": "kaya:add_velocity",
    "method": "single",
    "space": "world",
    "entity": "this",
    "velocity": [
        0.0,
        10.0,
        0.0
    ]
}

This example will launch the entity from the kaya:this_entity context parameter high in the air.

{
    "type": "kaya:add_velocity",
    "method": "pair",
    "reference": "rotation",
    "first": "actor",
    "second": "target",
    "velocity": [
        0.0,
        0.0,
        -2.0
    ]
}

This example will essentially pull the entity from the kaya:target_entity context parameter to the entity from the kaya:actor_entity context parameter.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.