Entity Goals
Entity goals define AI behaviors for your entity.
Use the "goal" field to specify the entities goals. Vanilla Minecraft uses 2 systems for entity AI, Brains and Goals.
Filament currently only supports the goal system.
All AI goals have a priority, lower priority = higher chance for the goal to run.
[
{
"type": "look_at_mob_goal",
"priority": 1,
"target": "minecraft:player",
"look_distance": 8.0,
"probability": 0.02,
"only_horizontal": true
}
]
Goal Types
float_goal
Entity stays afloat in water.
look_at_mob_goal
Makes the entity look at nearby entities of a specific type.
priority: Determines execution order.target: The entity type to look at (e.g."minecraft:player").look_distance: Max distance within which the target is visible.probability: Chance per tick to start looking. From0.0to1.0.only_horizontal: Iftrue, the entity only rotates horizontally.
melee_attack_goal
Makes the entity perform melee attacks on its target.
priority: Determines execution order.speed_modifier: Movement speed multiplier.following_target_even_if_not_seen: Iftrue, the entity keeps following even if it loses sight.
move_through_village_goal
Allows the entity to navigate through villages.
priority: Determines execution order.speed_modifier: Movement speed multiplier.only_at_night: Iftrue, goal activates only at night.distance_to_poi: Max distance to a point of interest.can_deal_with_doors: Iftrue, allows door interaction.
random_look_around_goal
Entity randomly looks around occasionally.
remove_block_goal
Allows the entity to remove blocks of a certain type.
priority: Determines execution order.block: The block to be removed (as blockstate identifier).speed_modifier: Movement speed multiplier.vertical_search_range: How far vertically the entity looks for blocks to remove.
water_avoiding_random_stroll_goal
Like random_stroll, but avoids walking into water.
priority: Determines execution order.speed_modifier: Movement speed multiplier.probability: Chance per tick to begin strolling.
defend_village_goal
Triggers when hostile mobs threaten a village.
hurt_by_target_goal
Targets and attacks entities that have hurt this entity.
priority: Determines execution order.ignore_from: List of entity types that are ignored even if they cause damage.alert_others: List of entities to alert when this entity is attacked.
nearest_attackable_target_goal
Targets the nearest valid entity.
priority: Determines execution order.target: Entity type to target (e.g.,"minecraft:player").random_interval: Delay between reevaluations.must_see: Iftrue, entity must see the target.must_reach: Iftrue, entity must be able to reach the target.ignore_baby: Ignores baby versions of the entity type.ignore_in_water: Ignores targets in water.
break_door_goal
Allows the entity to break doors under certain difficulties.
priority: Determines execution order.door_break_time: Time in ticks to break the door. Default:240.valid_difficulties: List of difficulty levels where breaking is allowed (e.g.["hard", "normal"]).
breed_goal
Enables breeding behavior with compatible entities.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.
eat_block_goal
Allows the entity to consume a specific type of block, like sheep do
flee_sun_goal
Causes the entity to flee from sunlight.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.
follow_boat_goal
Makes the entity follow a boat
follow_mob_goal
Enables following another mob
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.stop_distance: Max distance to stop following.area_size: (needs docs)
follow_parent_goal
Baby entity follow adult versions of itself.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.
move_towards_target_goal
Moves the entity towards its targeted entity
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.within: Distance threshold for stopping.
open_door_goal
Allows the entity to open and optionally close doors.
priority: Determines execution order.close_door: Iftrue, entity will close the door after opening. Default:true.
panic_goal
Entity panics and runs when damaged.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.damage_type: Trigger type for panic (e.g."minecraft:panic_causes").
random_stroll_goal
Entity strolls randomly.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.interval: Delay between strolls. Default:240ticks.check_no_action_time: Iftrue, strolling depends on idle time.
random_swimming_goal
Entity swims randomly in water.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.interval: Delay between swim actions. Default:240ticks.
stroll_through_village_goal
Strolls through villages.
priority: Determines execution order.interval: Delay between strolls. Default:100ticks.
tempt_goal
Entity is lured by certain items or item tags.
priority: Determines execution order.speed_modifier: Movement speed multiplier. Default:1.0.can_scare: Iftrue, entity may flee when startled.items: Specific items that tempt the entity (e.g.,["minecraft:carrot"]).item_tags: Tags that group valid tempting items.
try_find_water_goal
Entity tries to find a nearby water source.