Origins: Powerful Powers
» Entity actions » Action on start tracking

Action on start tracking

origins-powerful-powers:action_on_start_trackingpower type

Runs actions when the server starts sending an entity to the holder. Players only.

FieldTypeDefaultDescription
bientity_actionBi-entity actionoptionalActor: the holder. Target: the entity now being sent.
bientity_conditionBi-entity conditionoptionalIf set, the action only runs when it's true.
  • It's based on network range: the entity type's tracking range, scaled by the server's entity-broadcast-range-percentage and capped by view distance. Walls, look direction and invisibility are ignored.
  • It fires again each time the entity comes back into range, and for every entity near a player who joins or teleports, so keep its condition cheap.

Example: you hear a heartbeat when a warden comes into range.

json
{
  "type": "origins-powerful-powers:action_on_start_tracking",
  "bientity_condition": {
    "type": "origins:target_condition",
    "condition": {
      "type": "origins:entity_type",
      "entity_type": "minecraft:warden"
    }
  },
  "bientity_action": {
    "type": "origins:actor_action",
    "action": {
      "type": "origins:execute_command",
      "command": "playsound minecraft:entity.warden.heartbeat player @s"
    }
  }
}