mobs are spinning on the spot. what to do?

Started by FreeDom on

Topic category: Help with modding (Java Edition)

Last seen on 12:30, 4. Jul 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
mobs are spinning on the spot. what to do?

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?

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what are all the AI tasks…
Thu, 06/09/2022 - 23:20

what are all the AI tasks exactly

this might be a minecraft bug

Last seen on 12:30, 4. Jul 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
public static class…
Fri, 06/10/2022 - 06:50

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));
        }

 

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could try playing around…
Fri, 06/10/2022 - 15:48

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

Last seen on 12:30, 4. Jul 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
all of them are not spinning…
Sat, 06/11/2022 - 09:16

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.

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
well good thing you…
Sat, 06/11/2022 - 17:56

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

Last seen on 12:30, 4. Jul 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks!  
Sun, 06/12/2022 - 05:33

thanks!