If a mob dies while falling and lands on farmland during its death animation, it can still trample the farmland into dirt and break any crop on it. Dead entities shouldn’t affect the world like this. Other block effects are already turned off for dead entities, as explained in the code analysis below.
public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
if (level instanceof ServerLevel serverLevel
&& level.getRandom().nextFloat() < fallDistance - 0.5
&& entity instanceof LivingEntity) {
boolean canTrample = entity instanceof Player player
? !level.getServer().isUnderSpawnProtection(serverLevel, pos, player)
: serverLevel.getGameRules().get(GameRules.MOB_GRIEFING);
if (canTrample && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) {
this.turnToBaseBlock(entity, state, level, pos);
}
}
super.fallOn(level, state, pos, entity, fallDistance);
}
Dying mobs keep moving during their death animation, so “Entity.checkFallDamage()” still calls “fallOn()” when they land.
Steps to reproduce are in the video.
Thank you for helping us improve Minecraft! We saved your files: