On this page

Mob Pathing (Power Type)

Changes how the mob that has the power finds its way. It can plan routes up taller steps and down longer drops, keep following a path while in the air, and treat chosen blocks as preferred, costly or impassable.

Type ID: aea:mob_pathing

The power only works on mobs. If a mob has several active aea:mob_pathing powers, the first one is used.

Fields

FieldTypeDefaultDescription
jump_heightFloat or ExpressionoptionalHow many blocks up the mob may plan to step at once. Rounded down, at most 8. It can only raise the mob's normal limit.
drop_heightFloat or ExpressionoptionalHow many blocks down the mob is willing to drop. Rounded down, at most 256. It replaces the mob's normal limit.
airborne_pathingBooleanfalseLets the mob keep following and updating its path while it is off the ground. Mobs normally wait until they land.
airborne_reachFloat4.0Used with airborne_pathing. While the mob is in the air, the next point of its path counts as reached when the mob is up to this many blocks above it.
walkableBlock ConditionoptionalThe mob only walks where the block at the position, or the block under it, passes this condition. Points in open air, water and lava are not checked.
blockedBlock ConditionoptionalPositions whose block passes this condition are impassable.
avoidArray of avoid rules[]Blocks the mob prefers to stay away from.
penaltiesObject{}Replaces the mob's cost for node types. Each key is a node type and each value is a number.
repath_intervalInteger0Recalculates the mob's current path every this many ticks. 0 turns it off.

Avoid rules

FieldTypeDefaultDescription
block_conditionBlock ConditionThe blocks this rule applies to. It is tested on the block at the position and the block under it.
penaltyFloat8.0Extra cost for walking there. Higher values make the mob take longer detours. A negative value makes the position impassable.

When several rules match one position, the highest penalty is used. Only the first 30 rules are read.

Node types

The game sorts every position into a node type while it plans a route. In penalties, 0 means no extra cost, higher numbers make the mob avoid that type, and a negative number means the mob never walks there.

blocked, open, walkable, walkable_door, trapdoor, powder_snow, danger_powder_snow, fence, lava, water, water_border, rail, unpassable_rail, danger_fire, damage_fire, danger_other, damage_other, door_open, door_wood_closed, door_iron_closed, breach, leaves, sticky_honey, cocoa, damage_cautious

Examples

{
    "type": "aea:mob_pathing",
    "jump_height": 3,
    "drop_height": 12,
    "airborne_pathing": true,
    "repath_interval": 20
}

The mob plans routes up 3 block ledges and down 12 block drops, keeps steering while in the air, and rechecks its route once a second.

{
    "type": "aea:mob_pathing",
    "penalties": {
        "water": -1,
        "danger_fire": 0
    },
    "avoid": [
        {
            "block_condition": {
                "type": "apoli:block",
                "block": "minecraft:soul_sand"
            },
            "penalty": 16
        }
    ]
}

The mob never enters water, walks next to fire without hesitating, and goes around soul sand unless the detour is long.