mobs are spinning on the spot. what to do?

Started by FreeDom on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Jun 2022
Points:
314

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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?

Active 2 months ago
Joined Jul 2017
Points:
1015

User statistics:

  • Modifications: 1
  • Forum topics: 16
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 475
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

Active 2 years ago
Joined Jun 2022
Points:
314

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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));
        }

 

Active 2 months ago
Joined Jul 2017
Points:
1015

User statistics:

  • Modifications: 1
  • Forum topics: 16
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 475
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

Active 2 years ago
Joined Jun 2022
Points:
314

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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.

Active 2 months ago
Joined Jul 2017
Points:
1015

User statistics:

  • Modifications: 1
  • Forum topics: 16
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 475
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

Active 2 years ago
Joined Jun 2022
Points:
314

User statistics:

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

thanks!