Send Action (Entity Action Type)
Hands off to an apoli:receive_action power on the same entity, which decides what happens.
Use it to write shared behaviour once. Instead of copying the same block of actions into six powers, put it in one receiver and have the six send to it. The receiver is a normal power, so it can be granted, revoked, suppressed and conditioned like any other, and the same trigger can do different things depending on which receiver the entity holds at the time.
Type ID: apoli:send_action (also shappoli:send_action)
Fields
| Field | Type | Default | Description |
|---|---|---|---|
receiver | Identifier | required | The ID of a power on the same entity. Nothing happens if the entity doesn't have it, if it is suppressed, if its own condition fails, or if it isn't the right receiving type. |
Example
One receiver holds what happens when the player spends blood:
{
"type": "apoli:receive_action",
"entity_action": {
"type": "apoli:and",
"actions": [
{ "type": "apoli:change_resource", "resource": "vampire:blood", "change": -1 },
{ "type": "apoli:play_sound", "sound": "minecraft:entity.generic.drink" }
]
}
}Every power that costs blood sends to it, and none of them needs to know how blood works:
{
"type": "apoli:action_on_key_press",
"key": { "key": "key.origins.primary_active" },
"entity_action": {
"type": "apoli:and",
"actions": [
{ "type": "apoli:set_on_fire", "duration": 4 },
{ "type": "apoli:send_action", "receiver": "vampire:spend_blood" }
]
}
}Swap the receiver for one that costs hunger instead and every sender changes with it.