mojira.dev
MC-304550

Items with the `minecraft:attack_range` component do not have an increased pick radius for redirectable projectiles

The Bug


Under normal circumstances, for regular items, the method getPickRadius() in Entity is called within getEntityHitResult(final Entity except, final Vec3 from, final Vec3 to, final AABB box, final Predicate<Entity> matching, final double maxValue) to inflate the entity’s bounding box. For redirectable projectiles, getPickRadius() will return 1, however inside of getManyEntityHitResult(final Level level, final Entity source, final Vec3 from, final Vec3 to, final AABB targetSearchArea, final Predicate<Entity> matching, final float entityMargin, final Block clipType, final boolean includeFromEntity), the entity’s bounding box is only inflated by the input hitbox margin since this method gets used by projectiles as well.

However, in the case of the Spear or any item with the minecraft:attack_range component, the pick radius will be bypassed, meaning that in the case of an attack being performed to deflect a fireball, it will be harder to hit than players would expect.

Steps to Reproduce


  1. Align the player’s rotation using /tp @s ~ ~ ~ 0 0

  2. Summon a Fireball using the command /summon minecraft:fireball ~ ~2.5 ~3

  3. Attempt to deflect the fireball with a spear

  4. Notice that the spear fails to hit the fireball

  5. Attack again with the fist

  6. Notice it gets deflected

Expected Result


It should be easier to hit a fireball with the spear, much like how easy it is to hit a fireball with a usual weapon

Actual Result


The spear’s hitbox margin is the only one taken into account for attacking a fireball

Attachments

Comments 3

Screenshot of the issue

Screenshot_2025-11-25_174406.png

Note that the screenshot is to show how to aim oneself to reproduce the issue, it does not show the issue itself.

Also I have come up with better reproduction steps

Rachel Arevalo

(Unassigned)

1525137

Confirmed

Expansion A

Normal

Combat

1.21.11 Pre-Release 3, 1.21.11 Pre-Release 5

Retrieved