mojira.dev
MC-278949

Farmland randomly does not get trampled when jumping on it while running

While sprinting, jumping on farmland sometimes does not cause it to be trampled.

How to reproduce:

  1. Build a flat surface of farmland.

  2. Stand on one edge.

  3. Begin sprinting while on it.

  4. Jump.

Expected result:

Farmland would be trampled by jumping on it while sprinting.

Observed result:

Farmland sometimes does not get trampled by jumping on it while sprinting:

Video:

https://youtu.be/YccwH6xCHb8

Related issues

Attachments

Comments

migrated
[media]
Viradex

Is your game vanilla or modded? I'm asking because of this at the start of your video (chat messages):

[media]
Dan4658

Unmodded. Just had to use creative mode to fasten the situation obviously to not waste more time than necessary to reproduce this

 

Viradex

I wasn't talking about the gamemode, rather the chat messages. Thanks for the clarification.

MrMuskle

I am able to reproduce the reported behavior. It has been present ever since trampling farmland by falling was introduced in Minecraft 11w48a. It has specifically been programmed to behave that way.

Minecraft 11w48a, unmapped

agg.java

public class agg extends ns {
   // ...
   @Override
   public void a(uy var1, int var2, int var3, int var4, mh var5, float var6) {
      if (var1.w.nextFloat() < var6 - 0.5F) {
         var1.g(var2, var3, var4, ns.x.bO);
      }
   }
   // ...
}

Minecraft 1.21.4, official mappings

net/minecraft/world/level/block/FarmBlock.java

public class FarmBlock extends Block {
   // ...
   @Override
   public void fallOn(Level $$0, BlockState $$1, BlockPos $$2, Entity $$3, float $$4) {
      if ($$0 instanceof ServerLevel $$5
         && $$0.random.nextFloat() < $$4 - 0.5F
         && $$3 instanceof LivingEntity
         && ($$3 instanceof Player || $$5.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))
         && $$3.getBbWidth() * $$3.getBbWidth() * $$3.getBbHeight() > 0.512F) {
         turnToDirt($$3, $$1, $$0, $$2);
      }
      // ...
   }
   // ...
}

If the entity is falling from a distance of 0.5 or less blocks, the farmland never turns to dirt. If the entity is falling from a distance greater than 1.5 blocks, the farmland always turns to dirt. In between, a randomness factor applies.

Dan4658

Wow, interesting. Does randomness factor in your opinion make sense here? How would that relate to realism (somewhat, at least, I mean)?

Gullyman4

Duplicate of MC-262408. This is confirmed to be intentional by @unknown.

Dan4658

Aaaah, probably as if you would trip in reality and then when you are lucky you step next to the plant instead of on it, haha. Nice

Dan4658

(Unassigned)

Confirmed

(Unassigned)

1.21.4

Retrieved