The bug
Projectiles hit the player, snowman and witch who threw them at certain angles or close to the entities.
The projectile would hit players, snowman and witch the head, causing unable to successfully emission.
β’ Notes:
It can only be achieved in the face certain angle.
Approaching entities comparatively easy to reproduce.
This also happens in snowman.
Also affect the ride a entity.
β’ Projectiles types:
Snowballs
Egg
Ender Pearl
Arrow (It will hurt the players themselves.)
Splash Potions
Lingering Potions
How to reproduce
This can be consistently reproduced by flying into the air in creative and then running these 2 commands (while not moving), and then shooting an egg:
/summon zombie ~ ~ ~-1 {NoAI:1b}
/tp @p ~ ~ ~ 102.0 68.5
The exact range of movement varies, but this is one consistent angle.
Examples
Here are a few examples in videos:
Video 1 (Snowballs, egg and ender pearl): https://www.youtube.com/watch?v=q0DzNQxn-p0
Video 2 (Splash potions and lingering potions): https://www.youtube.com/watch?v=hUaRVsjkCIA
Video 3 (This also happens in snowman): https://www.youtube.com/watch?v=5Ug_jCZznUA
Code analysis
Code analysis by @unknown can be found in this comment.
Note: @unknown pointed out that the thrower
field has to be synchronized for the client to make sure the projectile behaves correctly client-side as well.
Related issues
discovered while testing
is duplicated by
relates to
Attachments
Comments


Snowballs, Eggs and Ender Pearls cannot hurt mobs. They can only push them back.
Survival mode also has this issue.
Moreover, throwing out items will not recycle.
Version 1.8.8 does not have this issue.

Reopened.
Thank you

I added a third person view attachment of the issue

Request: Change the description of the issue to the actual issue.
Changed

But the issue doesn't relate to mobs at all. It's happening because of the snowball hitting the player's head, a mob doesn't have to be close (Or exist at all) for the issue to happen.
Description changed again

This is a more general case of MC-84846, as generally I'm throwing eggs to get chicks to spawn and since 15w31c I've had to stand in the chicken compound.
As an additional note, I was running either 15w39b or 15w39c this week and I noted that the falling chick pushed me out of the way.
This issue relates to MC-84846
Arrow (It will hurt the players themselves.)

I'm still not sure why this issue isn't confirmed yet. It has been duplicated 3 times, contains a video and screenshots, why can't it be confirmed?

Not all reports are confirmed, this would require moderators reproducing every single bug. On this one, well, I can't reproduce it.

@Les3awe, please, use preview feature. Every single change is sent to watchers' emails.
Thank you for reminding, next time will pay attention. π
β New video:
https://www.youtube.com/watch?v=5Ug_jCZznUA

Does MC-83684 describe this issue?
Is not entirely. π

Relates to MC-83684

Possible repro case in MC-95976.

This issue is very easy to be reproduced. Grab a snowball and stand next to an entity, throwing it and it does not knockback the entity because the snowball is not hitting the entity but yourself even on current newest version. Why redstonehleper cannot reproduce this issue?

I never tried.

This makes the infinite elytra flight possible, correct?

So is this just never going to be fixed?

Please consider fixing this. This bug breaks many spigot mods and the spigot devs are unable to create a workaround for this bug. Plugins which use projectiles, such as Crackshot and many more including minigame plugins, simply do not work properly anymore

I think a workaround would be to don't let any projectile collide with anything for the first one or two ticks of its existence.

How about instead making it so the one firing the projectile can't be hurt by their own projectile.

James, I'll make a quick bug plugin and throw it up on spigot in a few hours to stop the projectiles hitting the player that throws / projects them this may cause a few items to "vanish" but it'll stop the people from being damaged by the projectile.

That could still delete the projectile. I think the correct fix would be to create the projectiles at the first point of its path that's outside the hitbox of the thrower.
Projectiles should be emitted from the hand.
Much like MC-101655 mentioned.

Are all these reports not enough to fix this issue?
Please fix the projectile issue. If this is a Combat update then at least re-look at projectiles as a from also.
I can say that snowballs as projectiles are a issue for me also.
So add another to this list of please help resolve this for us.
We are not asking for a new Mob etc etc, just that you put the projectiles back to more how they had been or fix the above issue. Players are killing themselves in snowball fights.
They are pretty much broken at this point. So if not planned to take them out please fix the issue.

I seconds Zach. This has become an issue both on my server and many others. Both singleplayer and online and plugins and mods are being affected. Do you care about this issue at all?

You can't kill yourself with a snowball...
I only had this issue when aiming up at least 30Β°, I think.

Words cannot describe how badly this needs patching. It has the potential to wipe out an entire genre of servers. I cant even throw a snowball without hitting myself 20% of the time! Arrows do the same thing!

I know this issue is bothering you but, can you try not to complain about it.

The only way this is ever going to be resolved is by informing them and letting them know its a issue.
Also would not see this as complaining as much as a posing about a MC issue.
This was not in previous versions and seeing as mobs are effect also this would I think be a bit of a concern.
Skeletons can kill themselves so can snowmen, an well so can players.
Do you want to be going in for your final hit and it come back to kill you?
Just saying this is more than a issue for even modded servers.
An looks poor on Minecrafts part to have arrows backfire and more.

I don't understand why they didn't fix this bug for 1.9.4
If you want the community to help further test and debug this Mojang, PLEASE let us know and we would be happy to do further testing. Me and many other server owners want this bug fixed

Just stop complaining until you have something new to say and click "Vote for this issue".

This bug probably won't be fixed in any of the 1.9 releases.

"This bug probably won't be fixed in any of the 1.9 releases."
Do you have facts to back this suggestion?
If not then why are you trying to get others to brush off the above issues, juts unfollow the issue if
you dont have a use for its fix or have no reason for its fixing.

I believe Mojang would have to change how projectiles work again in order to fix this issue.

No, that's not necessary. I already wrote an easy and failsafe fix in the comments:
"create the projectiles at the first point of its path that's outside the hitbox of the thrower"
or don't let them collide with anything until they are outside of the thrower's hitbox.

Until this is fixed, if you use Bukkit/Spigot, I have created a plugin that fixes it: http://dev.bukkit.org/bukkit-plugins/projectilebugfix/

Although that does cancel the self -damage, it doesn't fix the fact that the projectile should continue towards its intended destination. Just an FYI to those who might mistake this as a "fix;" rather, it mitigates the issue.

@RoboMWM So true. This issue is very critical for certain servers. I know a lot of servers are not updating because of this. And George, thanks for making the plugin. I wish I knew you could fix the issue using plugin.

With snowmen it happens quite often.

I hope this is going to be fixed.
I find it pretty messed up to see the community doing more to fix this than MC itself.
Seams some have even made a more permanent work around that does not just block the self damage.
I get you all have a million issues but this being more simple should be easy to knock out and then you
would have 1 less issue in your game. So please think about taking a few hours or so out of your
day to fix this or be lazy and redefine this as the default mechanics so we can all stfu.
I hope for the fix more than the stating this is the new default way projectiles act.
This can be reproduce so damn easy.
There is not even a need for all the post, unless you just want to make sure its a real bug before you fix it.
This is a real issue and think you should at the least take a few hours to
fix this or as I said above re-write this as the default way projectiles now fly.
Hoping for the Best
~ZachryWilsn

Hey!
I have made plugin called Projangtile which fixes this bug until Mojang fixes it.
It cancels self damaging and damages the real victim like in 1.8 or below.
https://www.spigotmc.org/resources/26823/
This works with CrackShot only though.
DeeCaaD

Can you maybe sum up the functionality how it works?

Basically:
If the damaged is the shooter self, damage is cancelled and from shooter's eye location is increased 5 blocks and checked on each block if there is entity on 0.75 range and if is then entity gets that damage which shooter was going to get.
Thats just basically ^^

What if you shoot balistically? Meaning: Shoot straight up, arrow slows down and comes back, hitting you. What happens with your mod?

Well then it will be only cancelled. It isn't perfect, I know. Ill try to improve it more though.

Maybe the projectile should only check it for the first 1-3 or so ticks. then it should behave correctly in all cases. (or until it leaves the hitbox of the shooter, that would actually be decent programming, so it would be better than what Mojang does with the Java version. π )

Yeah, I added right after my comment to projectile metadata which is set after 3 ticks of shot which fixes that.

Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The class net.minecraft.entity.projectile.EntityThrowable
(all throwable items, not arrows) has a field called net.minecraft.entity.projectile.EntityThrowable.ignoreEntity
which is used for determining which entity should not be damaged. I assume the problem here is that this entity is not necessarily the thrower (net.minecraft.entity.projectile.EntityThrowable.thrower
). This means that if the snowball is thrown and the thrower and another entity are in the "collision box" of the snowball, it could happen that the other entity is set as ignoreEntity
. Having the ignoreEntity be the thrower would probably solve this.
The following suggested fix includes a change to prevent the ignoreEntity to be reset if the thrown entity is not destroyed after hitting another entity.
Suggested fix
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.lastTickPosX = this.posX;
this.lastTickPosY = this.posY;
this.lastTickPosZ = this.posZ;
super.onUpdate();
if (this.throwableShake > 0)
{
--this.throwableShake;
}
if (this.inGround)
{
if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile)
{
++this.ticksInGround;
if (this.ticksInGround == 1200)
{
this.setDead();
}
return;
}
this.inGround = false;
this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}
else
{
++this.ticksInAir;
}
Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
RayTraceResult raytraceresult = this.worldObj.rayTraceBlocks(vec3d, vec3d1);
vec3d = new Vec3d(this.posX, this.posY, this.posZ);
vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (raytraceresult != null)
{
vec3d1 = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord);
}
Entity entity = null;
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expandXyz(1.0D));
double d0 = 0.0D;
boolean flag = false;
for (int i = 0; i < list.size(); ++i)
{
Entity entity1 = (Entity)list.get(i);
if (entity1.canBeCollidedWith())
{
if (entity1 == this.ignoreEntity)
{
flag = true;
}
// Replaced this to make only the thrower able to become the ignoreEntity
// else if (this.ticksExisted < 2 && this.ignoreEntity == null)
else if (this.ticksExisted < 2 && this.ignoreEntity == null && entity1 == this.thrower)
{
this.ignoreEntity = entity1;
flag = true;
}
else
{
/*
* Removed this because it can potentially cause problems if after the ignoreEntity
* another entity is tested that does not cause this EntityThrowable to be destroyed.
* In that case flag would be false causing ignoreEntity to be reset and causing the
* thrower to hit himself.
*/
// flag = false;
AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expandXyz(0.30000001192092896D);
RayTraceResult raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
if (raytraceresult1 != null)
{
double d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
entity = entity1;
d0 = d1;
}
}
}
}
}
if (this.ignoreEntity != null)
{
if (flag)
{
this.ignoreTime = 2;
}
else if (this.ignoreTime-- <= 0)
{
this.ignoreEntity = null;
}
}
if (entity != null)
{
raytraceresult = new RayTraceResult(entity);
}
if (raytraceresult != null)
{
if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && this.worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL)
{
this.setPortal(raytraceresult.getBlockPos());
}
else
{
this.onImpact(raytraceresult);
}
}
//...
}
For arrows the reason might be that the entity shooting the arrow can only not be hit by the arrow for 5 ticks, maybe this delay is too short. A solution similar to the one used for throwable entites could solve this.

Snowball is "fixed", it now continues, but also creates a duplicate that breaks instantly (or only the particle effect), see MC-106586.

Seems to still be an issue.. I hope this will be fixed soon. Getting annoying π

Exists in the 1.11 Pre-Release, hopefully it's removed for the official release of 1.11... I'm really counting on it.

This bug is very easy to fix. The code is there, it just isn't fully written..
In the EntityProjectile, the line that checks if the shooter is not null (and projectile life <2 ticks) does not actually check if the nearby collided entity is the shooter; and to ignore them. I have provided this fix to a third party server mod, but a gist comparison can be found here: https://gist.github.com/SupaHam/e15fc4e8cf9caecfa07f103b0d28ef6b

That wouldn't work because the call to onImpact happens clientside. The problem is that thrower
is not synced to the client so ignoreEntity is never set clientside. The ideal solution is to sync the thrower.

@Vincent Lee,
I can confirm that my solution works. Server implementations such as CraftBukkit (and Spigot) have been using it for months now with no issues.

I've been having this issue for as long as I can remember. I've never hit myself with an arrow, but thrown "arcing" objects consistently hit the player's head, especially eggs. I've also found that when shooting a bow from inside a minecart, the arrow easily hits the minecart, whereas a sword always ignores the minecart as it should.
This issue has been fixed in 17w47b.
Or blocked by MC-122335.
Projectiles can now penetrate the entity of close player.
But do not know whether the penetrate entity is working as intended.

Confirmed for 1.13. Noticed it while I was walking and threw an egg on my 1.13 survival server.

19w09a still

The two provided commands did not cause the bug to occur in 1.16 Pre-release 1
I seem to be difficult to reproduce the issue.
So the reporterβs position is given to @unknown.

Indeed, after many many tests, it seems that the bug is fixed since 1.16 Pre-Release 3.
It's very difficult to reproduce the bug...

Ender pearl thrown straight down while falling does not teleport you to the ground. Tried to reproduce and it seemed to not land in me either, it just disappeared not even resetting fall damage from that height. 1.16.2 bedrock playing on
Xbox one

This is not a MCBE bug report, this is the MCJava project. Ender pearls thrown downwards while falling work as expected in MCJava.