How to use MobGoals API

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

Leopold95

New member
Jul 29, 2024
1
0
1
Hello all. I want to develop some custom AI behaviour with using default behaviours to. I know, I can remove all AI and set cusom, but i dont need only cuson behaviours, i want use some default.

So question is: how to add default AI Mob goals to the Paper MobGoals API. Thak you all.

If u give me an example ill be happy.
 

Noy

New member
Jan 8, 2023
23
1
0
1
Hello all. I want to develop some custom AI behaviour with using default behaviours to. I know, I can remove all AI and set cusom, but i dont need only cuson behaviours, i want use some default.

So question is: how to add default AI Mob goals to the Paper MobGoals API. Thak you all.

If u give me an example ill be happy.
I can't find any method to create a vanilla goal, so I'm sorry but maybe you should dig into NMS:

Java:
Bukkit.getMobGoals().addGoal(mob, 1, new PaperVanillaGoal<>(
    new PanicGoal(((CraftMob)mob).getHandle(), 1.5)
));