Swap
too-many-attributes:swapbi-entity action
The actor and the target trade places. It works across dimensions.
| Field | Type | Default | Description |
|---|---|---|---|
x, y, z | Double | 0 | Where the actor lands, as an offset from the target's position. The target always lands where the actor stood. |
landing_block_condition | Block condition | optional | Checked on the block under the actor's landing spot. If false, nobody moves. |
landing_condition | Entity condition | optional | Checked on the actor as if it already stood at the landing spot. If false, nobody moves. Skipped when the swap crosses dimensions. |
loaded_chunks_only | Boolean | true | If the actor's landing spot is in an unloaded chunk, nobody moves. |
success_action | Bi-entity action | optional | Runs after the swap, with the same actor and target. |
fail_action | Bi-entity action | optional | Runs when a check stops the swap. |
- Both keep the way they're facing.
- A mob that changes dimension becomes a new copy of itself there.
success_actiongets the copy. - From Overgrown's Apoli: the fields match Overgrown's
swap, exceptspace. The offset is always in world directions. Overgrown'steleport_toisn't in TMA.
Example: "Switcheroo". Hitting an entity swaps places with it and plays the enderman teleport sound, once every 5 seconds.
{
"type": "origins:action_on_hit",
"bientity_action": {
"type": "too-many-attributes:swap",
"success_action": {
"type": "origins:actor_action",
"action": {
"type": "too-many-attributes:play_sound",
"sound": "minecraft:entity.enderman.teleport"
}
}
},
"cooldown": 100
}