Too Many Attributes
» Entity actions » Scare mobs

Scare mobs

too-many-attributes:scare_mobspower type

Nearby mobs run away from the holder, the way creepers flee cats.

FieldTypeDefaultDescription
bientity_conditionBi-entity conditionoptionalWhich mobs flee. Actor: the holder. Target: the mob. Left out: every mob.
radiusDouble6How close a mob has to be to flee, in blocks.
speedDouble1How fast it runs, as a multiple of its normal walking speed.
  • Mobs that walk by pathfinding flee. Slimes, ghasts, phantoms and other mobs that move another way don't.
  • Fleeing comes before everything else the mob is doing, attacking included.
  • With several holders nearby, a mob flees the nearest one that scares it.
  • From Overgrown's Apoli: the fields match.

Example: "Apex predator". Cows flee you within 10 blocks.

json
{
  "type": "too-many-attributes:scare_mobs",
  "bientity_condition": {
    "type": "origins:target_condition",
    "condition": {
      "type": "origins:entity_type",
      "entity_type": "minecraft:cow"
    }
  },
  "radius": 10,
  "speed": 1.4
}

To scare every animal, use an entity type tag or an origins:or of entity types in the target condition.