Skip to main content

Modify Entity Data (Entity Action Type)

Changes one piece of an entity's data, such as whether it has gravity. It works on any entity, living or not.

Type ID: apoli:modify_entity_data

note

apoli:set_entity_data and apoli:change_entity_data are plain renames of this action. apoli:set_no_gravity and apoli:set_gravity are shortcuts that fill in data: no_gravity, so you only give (or leave out) value.

Fields

FieldTypeDefaultDescription
dataStringrequiredWhich property to change (see the list below).
valueBoolean or FloatoptionalThe new value. For a boolean property, leaving value out flips the current state. For a number property, leaving it out does nothing.

data values

dataTypeProperty
no_gravitybooleanWhether the entity ignores gravity.
invulnerablebooleanWhether the entity is invulnerable.
silentbooleanWhether the entity is silent.
glowingbooleanWhether the entity has the glowing outline.
invisiblebooleanWhether the entity is invisible.
custom_name_visiblebooleanWhether the entity's custom name is always shown.
no_aibooleanWhether the mob's AI is turned off (mobs only).
fall_distancenumberThe fall distance built up so far.
airnumberRemaining air, in ticks.
fire_ticksnumberRemaining fire, in ticks.

Examples

"entity_action": {
    "type": "apoli:modify_entity_data",
    "data": "no_gravity",
    "value": true
}

This makes the entity ignore gravity. With the apoli:set_no_gravity alias, the same thing is:

"entity_action": {
   "type":"apoli:set_no_gravity",
   "value":true
}

Leave value out and it toggles gravity instead.

"entity_action": {
    "type": "apoli:modify_entity_data",
    "data": "fire_ticks",
    "value": 100
}

This sets the entity on fire for 5 seconds.