Started by
FreeDom
on
Topic category: Help with Minecraft modding (Java Edition)
hello everyone!
I created a mob, gave it an AI.
After he starts to sleep, the algorithm starts to wander, as soon as he stops, he starts spinning in place, instead of just standing, then starts to wander again.
How to remove this rotation?
what are all the AI tasks exactly
this might be a minecraft bug
public static class EntityCustom extends EntitySpider implements IRangedAttackMob {
public EntityCustom(World world) {
super(world);
setSize(0.5f, 0.8f);
experienceValue = 5;
this.isImmuneToFire = true;
setNoAI(!true);
enablePersistence();
}
@Override
protected void initEntityAI() {
super.initEntityAI();
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.tasks.addTask(2, new EntityAIPanic(this, 1.2));
this.tasks.addTask(3, new EntityAILookIdle(this));
this.tasks.addTask(4, new EntityAIWander(this, 1));
this.tasks.addTask(5, new EntityAISwimming(this));
this.tasks.addTask(6, new EntityAILeapAtTarget(this, (float) 0.8));
this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
}
you could try playing around to see what exactly causes it to spin
are there a bunch of entities around it that it's trying to leap at?
delete some of the AI tasks, and if it stops spinning, the thing you just deleted was what was causing it
this seems like a glitch with the programming of Minecraft itself (https://bugs.mojang.com/browse/MC-154548), and it says it affects 1.14.2, so if you're modding that version, updating it would be a good idea
if nothing works, try to find workarounds like using procedures to make a custom AI system
all of them are not spinning, it was because I put the entity base: spider. But the truth is because of this, they stopped climbing the walls.
well good thing you mentioned that
only use entity AI bases if you want to make an exact copy of that entity
entity AI bases limit your freedom a lot
i don't know what allows spiders to climb blocks, but you can find a workaround by placing an invisible ladder block on entity tick update and removing the ladder block if it sees that the entity is not occupying its space
thanks!