Jump to content

Recommended Posts

Posted (edited)

So, I have an animation for walking, but the entity only starts it for a second and jumps to the place it's wandering to instead of walking smoothly. It just move-stops, move-stops, move-stops. Like like a monopoly piece. i.e. it isn't wandering at a contant speed with a far destination, it just skips to a couple blocks in front with a little jitter, instead of wandering like any other mob.

package com.ninja3659.explorationexpansion.entitites;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;

public class EntityMindFlayer extends EntityMob{
	
	public EntityMindFlayer(World worldIn) {
		super(worldIn);
		this.experienceValue = 20;
		
	}
	
	@Override
	protected void entityInit() {
		super.entityInit();
	}
	
	@Override
	protected void initEntityAI() {
		this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true, false));
		this.tasks.addTask(0, new EntityAIAttackMelee(this, .5D, true));
		this.tasks.addTask(3, new EntityAIWander(this, 1D));//compare to EntityPig
	}
	
	@Override
	protected void applyEntityAttributes() {
		super.applyEntityAttributes();
		this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(10);
		this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(.000001D);
		this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(2);
		this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(20);
		this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(32);
	}
	
	@Override
	public void onLivingUpdate() {
		super.onLivingUpdate();
	}
	
}

 

EDIT: TIL, I suck at searching problems on google. I put the update frequency way too high.

Edited by GooberGunter
Solved

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.