mojira.dev
MC-299117

Arrow collision is inaccurate in 1.21.6+

Arrows fail to collide with entities unless the eye location of the arrow entity passes through the entity collision. This is incorrect & inconsistent with hitbox behavior across the game.

This means there is a significant portion of what ought to be hit conditions which fail, in scenarios which would succeed in prior versions

Attachments

Comments 7

Not really sure how to show this better, but the above screenshot is a simple setup to produce this issue. A portion of arrows shot from the dispenser will fail to collide, if they gain a deviation that sends them marginally away, but hit in all other cases. In both scenarios, the hitbox will ALWAYS indicate a collision should have occurred, and the system works in previous versions (v <= 1.21.5)

I have had a handful of other players test on independent machines & clients, and the issue is consistent across all users.

After looking through the source code, it appears the bug is tied a long-standing issue in the implementation of ProjectileUtil’s “getEntityHitResult”, wherein the hitbox size of an arrow was NEVER actually accounted for in the collision check. This was previously disguised by the constant 0.3 Margin factor, which was slightly larger than the discarded hitbox contribution (0.25b square radius).

In the new scaling margin system, it takes 7 ticks before the margin reaches 0.25 (the missing amount), and thus, for that window, the collision does not match due to the code ignoring the hitbox dimensions outright in favor of the margin term.

This, in turn, means that arrows can pass through other entities in scenarios where their hitbox as-rendered very much collides.

I wonder if this behaviour would need to be source dependent. I can see how it’s a good change for player shot projectiles where precision = skill, but for dispensers where there’s randomness, it makes things much more questionable.

Can confirm, in the latest updates, something feels VERY wrong with projectiles such as arrows and tridents. If a skeleton charges up a shot before you raise your shield, the fired arrow WILL hit you, regardless of the fact that you had the shield up before the arrow was fired (and no, it’s not a lag/server issue. this happens on single player, and it’s also when getting shot from right in front of you, so it’s not that you’re not blocking the arrows, it’s that they bypass the shield for some reason if you aren’t blocking before they charge a shot).

Player fired arrows/tridents now seemingly pass straight through mobs and deal no damage well over 25% of the time. At first I thought “wow, my aim must have suddenly gotten terrible!”, but then I turned on hitboxes. Nope, my aim is still pretty perfect, it’s just that arrows/tridents for some reason will just clip through a mob and deal no damage (often appearing to harmlessly bounce off said mob, but the resulting arrow will always be where it would have landed had no mob been there at all. It’s EXTREMELY FRUSTRATING when it happens with creepers, cuz the “missed” shot from point blank will result in you having to tank the blast that otherwise wouldn’t have happened had the projectile collision actually worked)

ANOTHER issue is that arrows fired from the bow will sometimes not appear. No arrow flying, no particle trail, nothing. it can still impact enemies (provided the collision actually works right), but it’s very annoying trying to calculate trajectory if you can’t even see where your previous projectile went if it was a long shot. The arrow WILL be visible upon contacting a surface, it just occasionally is not visible when they fly through the air.

PLEASE fix this mojang, this is incredibly frustrating.

After inspecting the diffs between 1.21.5 & 1.21.6+, the issue seems to be stemming from the change to the Margin system used to detect entity collision in ProjectileUtil (All projectiles).

Across both previous and afflicted versions, the actual hitbox of the projectile entity is ignored during the collision distance checks against entities, when it comes to the final validation. (Hitbox is used for computing the region in which to check against entities, as expected). Thus, the changes to the margin have actually led to the static emulation of hitbox size from previous versions being replaced with an effective scaling hitbox. This is NOT reflected in the debug hitboxes, which retain the static hitbox of the entity, with no information about effective size being portrayed.

Whether or not the new behavior is a good change is up for debate between players, as there are reasons to use both systems, but at the least, the debug renderer should be updated to properly reflect the new collision system, as the information portrayed is currently misleading/false.




Notably, this issue’s scope, as mentioned above by Kanji, means it affects much more than just arrows, including:

All mob projectiles:
Ghast fireballs, Dragon Fireballs, all Skeleton type’s arrows (tipped & otherwise), Blaze Fireballs, Wind Charges, Shulker Bullets, and Llama Spit

All throwables:
Ender Pearls, Eggs, Potions, Snowballs, etc.

All ranged weapons:
Crossbows & Bows (Arrows, Spectral Arrows, Tipped Arrows, Launched Fireworks Rockets)
Tridents

*Additionally, dispensers, due to their inherent larger randomness in projectile velocity, have drastically different performance in redstone devices due to the much tighter tolerances in close-range behavior severely affecting compact & technical systems.


This is a significant change to a large number of the game’s tolerances and likely merits further discussion.

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryThe official Minecraft feedback site

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Ampere O'Tea

(Unassigned)

Plausible

Collision

1.21.6, 1.21.7 Release Candidate 1

Retrieved