Mojira Archive
MC-73884

Throwable projectiles get destroyed at contact with non solid blocks

The bug

Throwable projectiles such as snowballs, potions and enderpearls break when hitting blocks without collision boxes, unlike arrows.

Affected projectiles

  • Ender pearl
  • Snowball
  • Egg
  • Bottle of enchanting
  • Splash/lingering potions
  • Llama spit

How to reproduce

Throw for example a snowball at a double height plant.

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.entity.projectile.EntityThrowable.onUpdate() calls the method net.minecraft.world.World.rayTraceBlocks(Vec3d, Vec3d) which includes blocks without collision box. Instead the method World.rayTraceBlocks(Vec3d, Vec3d, boolean, boolean, boolean) should be called with false (stopOnLiquid), true (ignoreBlockWithoutBoundingBox) and false (returnLastUncollidableBlock).