Jump to content

Recommended Posts

Posted (edited)

Hello users! So,I have one big problem I can't solve with EntityAIWander. When I add this task to my new class mob, it just does nothing. The mob stays still but also used memory is increasing. It takes about 1 minute to go from 20% used memory to 99%. On 99% its just not responding (no crashes) and I have to terminate the process. Also there are no any crash messages in console. After some small research I managed to find out that the line,on which its all happening is this(in the EntityAIWander class):

this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed);

 

And here is my full mob class code. However I dont see how it could help solving the problem.Sorry if the problem is obvious,I just started codding.

Quote

package com.genosse.dolbaebimod;

import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.monster.EntityMob;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;


public class kostyamob extends EntityMob
{
    public kostyamob(World par1World)
    {
        super(par1World);
        this.tasks.addTask(1, new EntityAIWander(this, 1.0D));
    }
    @Override
    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1.0D);
        this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(999.0D);
        this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D);

    }
    public boolean isAIEnabled()
    {
        return true;
    }
}

 

Edited by Genosse
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.