Skip to content

Mob Goal Edit Spell

JasperLorelai edited this page May 19, 2024 · 6 revisions

Source Code

spell-class: ".targeted.MobGoalEditSpell"

Warning

Introduced in 4.0 Beta 14.

Value Supported
entity true
location false
entity_from_location false

Description:

You can add Vanilla mob goals too by using the Antigone plugin addon.

Custom goals are removed from entities during server restart and sometimes during chunk unload (where the entity is). At the moment to have persistent goals you have to apply them along with a TagEntitySpell, then on the magicspellsloading passive trigger target all entities with an AOE spell with ignore-radius, filtering for entities with the applied tag, and target them with the same MobGoalEditSpell spell to re-apply goals.

Configuration:

Since 4.0 Beta 13 remove-all supports dynamic values through string expressions.

Options:

Option Description Type
remove-all Boolean, false by default
remove-types List of GoalType
remove-vanilla While you could use remove with the appropriate namespaced key (minecraft:...), the key sometimes differs from the VanillaGoal field name. This option also throws errors on invalid VanillaGoals listed - goals are often removed or renamed between minecraft versions. List of VanillaGoal
remove magicspells is the default namespace if left unspecified. List of NamespacedKey strings
add List of configuration sections to configure a custom goal to be added. Each should have a goal to specify the custom goal to add, an optional priority option (Integer, 0 by default), and a data configuration section to pass possibly required additional data to a goal. List of configuration sections

Example:

follow_me:
    spell-class: ".targeted.MobGoalEditSpell"
    always-granted: true
    cast-item: stick
    add:
      - goal: path_to
        priority: 1
        data:
            position:
                x: "%var:meta_location_x%"
                y: "%var:meta_location_y%"
                z: "%var:meta_location_z%"

Built-in custom goal data:

Since 4.0 Beta 13 these options support dynamic values through numeric or string expressions.

look_at_entity_type:

Due to default values, data in this goal isn't required.

Option Type Default
range Float 10
chance Float 100
only-horizontal Boolean false
type Entity Type player

path_to:

In this goal data is required because position is required.

Option Description Type Default
speed Walk speed. Double 0.2
position Position in the same world as the entity, hence a vector. Vector
distance-allowed Distance above which to activate the goal. Double 1
Clone this wiki locally