Entity Documentation - minecraft:behavior.defend_village_target
minecraft:behavior.defend_village_target
compels the entity to stay in a village and defend the village from aggressors. If a player is in bad standing with the village, this goal will cause the entity to attack the player regardless of filter conditions.
Parameters
Name | Default Value | Type | Description |
---|---|---|---|
attack_chance | 0.05 | Decimal | The percentage chance that the entity has to attack aggressors of its village, where 1.0 = 100%. |
entity_types | {} | JSON Object | Entity filter to determine which targets the behavior affects. |
must_reach | true | Boolean | The entity must be able to reach attacker. |
priority | 1 | Decimal | The percentage chance that the entity has to attack aggressors of its village, where 1.0 = 100%. |
priority | not set | Integer | The higher the priority, the sooner this behavior will be executed as a goal. |
Example
"minecraft:behavior.defend_village_target": {
"mount_speed_multiplier": 1.45,
"fractional_rotation": 0.5,
"fractional_rotation_limit": 5.0
}
Vanilla entities examples
iron golem
"minecraft:behavior.defend_village_target": {
"priority": 1,
"must_reach": true,
"attack_chance": 0.05,
"entity_types": {
"filters": {
"any_of": [
{ "test": "is_family", "subject": "other", "value": "mob" },
{ "test": "is_family", "subject": "other", "value": "player" }
]
}
}
}
Vanilla entities using defend_village_target
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈