The bug
If a fireball is shot with bow and arrow, it will not rebounce in the direction it gets hit but rather the direction the player is facing.
How to reproduce
Summon a fireball
/summon fireball ~ ~1 ~ {direction:[0.0,0.0,0.0],ExplosionPower:0}
Stand fair way away from it (~15 blocks)
Shoot an arrow at it, then, before the arrow hits the fireball, quickly look in another direction
→ ❌ The fireball will fly in the direction you looked rather than the one you shot the arrow
Video reference: https://gfycat.com/UnitedDistortedGrunion
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 3
Attachments
Comments 21
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason for this is that the method net.minecraft.entity.projectile.EntityFireball.attackEntityFrom(DamageSource, float)
uses the look vector of the entity attacking. For indirect damage sources this is the entity shooting the arrow for example. Instead maybe the motion of the damaging entity should be used (method net.minecraft.util.DamageSource.getSourceOfDamage()
).
After putting some more research into this behavior i came to assume that this has way more positive than negative behaviors to it and thus i would recommend it being "WAI"
I'd say this is WAI. It is intended to be this way so that players can defend themselves against Ghast Fireballs.
Can confirm in 1.19.2. Just to clarify, the fireball does not have to be shot with an arrow in order to reproduce this issue. It can be shot with other similar projectiles such as snowballs, eggs, etc...
See also this thread on reddit