Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.