Jump to content

[1.6.2]Mob Lag?


DaNatin

Recommended Posts

For some odd reason... my mobs MOVE VERY SLOW. I set my this.setAIMoveSpeed() to 1.0F (AND THAT'S FAST). Now when I'm in-game... sometimes, the mobs actually move at a fast pace, but they teleport to their previous location, as if it was the server lagging. Here is my entitymob code:

 

package assets.cutiesmod.entity;

import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBreakDoor;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import assets.cutiesmod.common.CutiesMod;

public class EntitySquishy extends EntityMob implements IBossDisplayData
{



 public EntitySquishy(World par1World) 
{
	super(par1World);
	this.setAIMoveSpeed(1.0F);

	this.isImmuneToFire = true;  
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
    this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityMaleCutie.class, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 1.0D, false));
    this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(5, new EntityAILookIdle(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true));
    this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
    this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityMaleCutie.class, 0, false));	




}




public int getMaxHealth()
{
	return 500;
}

public int getMaxDamage()
{
	return 16;
}


protected void dropFewItems(boolean par1, int par2)
    {
        int j = this.rand.nextInt(2 + par2);
        int k;

        for (k = 0; k < j; ++k)
        {
            this.dropItem(CutiesMod.ItemCutieSoul.itemID, 4);
        }

        j = this.rand.nextInt(2 + par2);

        for (k = 0; k < j; ++k)
        {
            this.dropItem(Item.slimeBall.itemID, 10);
        }
    }


public EnumCreatureAttribute getCreatureAttribute()
{
	return EnumCreatureAttribute.UNDEAD;
}




protected String getLivingSound()
    {
        return "mob.enderdragon.growl";
    }

    /**
     * Returns the sound this mob makes when it is hurt.
     */
    protected String getHurtSound()
    {
        return "mob.enderdragon.hit";
    }

    /**
     * Returns the sound this mob makes on death.
     */
    protected String getDeathSound()
    {
        return "mob.wither.death";
    }


}

 

All of my mobs do this... BUT I DON'T KNOW WHY!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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