Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-48320

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 14w06b, Minecraft 14w08a, Minecraft 14w10c, Minecraft 14w11b, Minecraft 14w34c, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 15w45a, Minecraft 1.10.2, Minecraft 1.11.2, Minecraft 1.12.1, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 19w04b, Minecraft 19w07a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14.3, 1.15.2, 20w06a, 20w12a
    • None
    • Confirmed
    • Minecart, Projectiles

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

            Unassigned Unassigned
            Asteraoth [Mod] Asteraoth
            Votes:
            22 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: