mojira.dev
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).

Linked issues

MC-87983 ender pearl to stop in the grass Resolved MC-94428 eggs, snowballs, splash potions, fishing rod float and ender pearls breaks on tripwire, opened fence gate and cobweb Resolved MC-95945 Bobbers can't go through sugar canes. Resolved MC-102749 Snowballs, Eggs, and Potions break when hitting tall grass and flowers Resolved MC-106119 The snowballs will not pass through the grass Resolved

Comments 27

Can't replicate this issue.

What do you mean by this, for which non-solid block couldn't you replicate it?

Confirmed, but it has always been like this (haven't tested arrows and fishing rods yet though).

I misinterpreted the bug report. I am saying this is working as intended.

I tried throwing all the entities listed at non-solid blocks. I assumed the reporter meant transparent blocks since non-solid blocks would mean air and/or water which doesn't destroy any of these. I tried glowstone, pistons, and glass and the entities all get destroyed except for the arrow (which sticks in the block) and fishing bobber (which just sits there) as expected. Eggs, Fireballs, Snowballs, bottles o' enchanting, and splash potions have always been destroyed when hitting any block.

Unless I'm missing something this is working as intended.

Non-solid blocks are blocks that do not impede player/mob movement, such as tall grass, flowers, tripwire, vines, torches etc.

17 more comments

Affects 1.13-pre7

Confirmed for 1.13.1.

gaspoweredpick

Confirmed for 19w09a. The same thing applies to llama spit as well.

20w06a affected

finally fixed in 1.16.2 pre 1

marcono1234

slicedlime

Confirmed

Collision, Projectiles

contact, explosion, fireball, non-solid, non-solid-blocks, projectile

Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 15w36c, Minecraft 15w45a, Minecraft 15w49b, ..., 20w06a, 20w19a, 1.16 Pre-release 1, 1.16 Pre-release 7, 1.16.1

Minecraft 15w49a, 1.16.2 Pre-release 1

Retrieved