Mojira Archive
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;
        		}
        	}
	}
    }