mojira.dev
MC-48320

Firing an arrow at the minecart while riding in a minecart breaks minecart

The bug

Firing an arrow from a bow while riding in a minecart causes the minecart to break.

The fix

This can be fixed by checking if the shooter of the arrow is the rider and returning false.

EntityMinecart.java (MCP)

public boolean attackEntityFrom(DamageSource source, float amount)
    {
        if (!this.worldObj.isRemote && !this.isDead)
        {
        	if (source.getSourceOfDamage() instanceof EntityArrow) 
        	{
        		EntityArrow arrow = (EntityArrow) source.getSourceOfDamage();

        		if(this.getPassengers().contains(arrow.shootingEntity))
        		{
        			return false;
        		}
        	}
	}
    }

Linked issues

Attachments

Comments

kumasasa

Confirmed.

Roadsguy

They made it so that minecarts' hitbox is two blocks tall now, so that they can be pushed off rails. That's the only practical application for this, and it not only breaks shooting from a minecart, but it also breaks some machines, like Etho's mob sorter. Bug or not, this should be fixed.

Tim Verrilli

Confirmed. In addition, if the rail is on a single block with a space below you will fall completely through the block and space. This is particularly dangerous for covered rail bridges in the nether.

qmagnet

Tested in 14w34c. Minecraft only breaks when bow is aimed at it. Arrow can easily be shot out of minecart during riding.

Sonicwave

Confirmed for 1.8.

Sonicwave

Still an issue in 1.8.1-pre2.

Jeremy

confirmed for 1.8.1 pre-3. Also affects boats when firing an arrow from inside them. This makes pvp between boats nearly impossible.

Swekob

Confirmed for 15w45a.

Can't confirm you get stuck in the ground. It's fixed.

Asteraoth

Confirmed for 1.13-pre8

Asteraoth

Confirmed for 1.13

Asteraoth

Confirmed for 18w30b

Megalodab

This happens to me a lot especially when you are aiming down far enough so it seems like the bow's arrow is just above the 'side' of the boat/minecart you are in, but you would clearly expect the projectile to travel over the edge of your minecart and to whatever target you're looking at.

This also happens to horses sometimes, a bug that was fixed in earlier updates but needs to be reopened because its still happening in 1.14.2: https://bugs.mojang.com/browse/MC-13727 Also when youre in a boat, the arrow you shoot can sometimes hit the other entity riding behind u in the boat, for example a parrot or dog. Haven't tested if a player riding in the boat will get hit. opened bug report on this: https://bugs.mojang.com/browse/MC-154485

Oval

Confirmed for 20w06a.

Asteraoth

This has been fixed in 20w14a. Forward-resolving as a duplicate of MC-176195.

Bob Chmilnitzky

Asteraoth

(Unassigned)

Confirmed

Minecart, Projectiles

Minecraft 14w06b, Minecraft 14w08a, Minecraft 14w10c, Minecraft 14w11b, Minecraft 14w34c, ..., Minecraft 19w14b, Minecraft 1.14.3, 1.15.2, 20w06a, 20w12a

Retrieved