slime movement

This commit is contained in:
Sen 2025-04-07 18:22:22 +02:00
parent 3515fb1792
commit 262a4adfe0

View file

@ -93,6 +93,15 @@ public class EntitySlime extends EntityNPC
public Alignment getNaturalAlign() { public Alignment getNaturalAlign() {
return rand.pick(Alignment.LAWFUL_EVIL, Alignment.EVIL); return rand.pick(Alignment.LAWFUL_EVIL, Alignment.EVIL);
} }
public void updateEntityActionState()
{
super.updateEntityActionState();
if(this.isPlayer() && this.onGround) {
this.moveStrafe = 0.0f;
this.moveForward = 0.0f;
}
}
// public boolean canAmbush(EntityLiving entity) { // public boolean canAmbush(EntityLiving entity) {
// return true; // return true;
@ -450,7 +459,7 @@ public class EntitySlime extends EntityNPC
} }
protected double getJumpMovement() { protected double getJumpMovement() {
return ExtMath.clampd(this.rand.drange(0.3, 0.8) * this.height, 0.2, 1.0); return ExtMath.clampd((this.isPlayer() ? (this.isSneaking() ? 0.3 : (this.isSprinting() ? 0.8 : 0.55)) : this.rand.drange(0.3, 0.8)) * this.height, 0.2, 1.0);
} }
/** /**