Restore the npc step height even if the hitbox nudge throws

This commit is contained in:
KAMKEEL committed 2026-08-13 06:06:14 -04:00
1 parent b6f2bae770
commit 8612d4442a
1 file changed
+5 -2
@@ -1343,8 +1343,11 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
// npc up onto whatever it now touches. Only the horizontal push is wanted here.
float prevStepHeight = this.stepHeight;
this.stepHeight = 0.0F;
this.moveEntity(oldWidth - newWidth, 0.0D, oldWidth - newWidth);
this.stepHeight = prevStepHeight;
try {
this.moveEntity(oldWidth - newWidth, 0.0D, oldWidth - newWidth);
} finally {
this.stepHeight = prevStepHeight;
}
}
}