AI tasks in 1.12.2 generator

Started by Maxim Doroshko on

Topic category: Help with modding (Java Edition)

Last seen on 17:29, 2. Apr 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
AI tasks in 1.12.2 generator

Hi! I want to create pet in my mod.
I use this tasks, but my pet only follow me. It doesn't attack my enemy.

@Override
        protected void initEntityAI() {
            super.initEntityAI();
            this.tasks.addTask(0, new EntityAIFollowOwner(this, 1.5D, (float) 5.0, (float) 10.0));
            this.targetTasks.addTask(0, new EntityAIOwnerHurtTarget(this));
            this.targetTasks.addTask(0, new EntityAIOwnerHurtByTarget(this));
            this.tasks.addTask(1, new EntityAIWander(this, 1.5));
            this.tasks.addTask(2, new EntityAILookIdle(this));
            this.tasks.addTask(3, new EntityAISwimming(this));
        }
 

What's wrong?