Skip to main content

Relative Action (Entity Action Type)

Runs an entity action on whatever the entity is riding, or on whatever is riding it. target decides the direction, and the aliases fill it in: apoli:passenger_action targets passengers and apoli:riding_action targets the vehicle.

Type ID: apoli:relative_action (aliases apoli:passenger_action and apoli:riding_action)

Fields

FieldTypeDefaultDescription
actionEntity Action TypeoptionalRuns on the relative entity, with that entity as the actor.
bientity_actionBi-entity Action TypeoptionalRuns with this entity as the actor and the relative entity as the target, so the two can still be told apart.
bientity_conditionBi-entity Condition TypeoptionalChecked against the same actor and target. A relative entity that fails it is skipped.
targetStringpassengerpassenger acts on entities riding this one, and vehicle acts on what this one is riding. The aliases fill this in.
recursiveBooleanfalseFollows the chain all the way: every passenger's passengers, or every vehicle's vehicle.

Both actions are optional, and both run when both are given. With neither, the action does nothing.

Examples

Set whoever is riding you on fire:

{
  "type": "apoli:passenger_action",
  "action": { "type": "apoli:set_on_fire", "duration": 4 }
}

Heal the horse you are riding whenever you eat:

{
  "type": "apoli:action_on_item_use",
  "item_condition": { "type": "apoli:food" },
  "entity_action": {
    "type": "apoli:riding_action",
    "action": { "type": "apoli:heal", "amount": 4 }
  }
}

Launch the whole stack together, such as a boat carrying a minecart carrying a player:

{
  "type": "apoli:passenger_action",
  "recursive": true,
  "action": { "type": "apoli:add_velocity", "y": 1.5 }
}