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

Cannot pick up arrow shot by dispenser in stairs / half slabs

XMLWordPrintable

    • Confirmed

      The bug

      When an arrow is shot by a dispenser facing a half slab or stairs, the arrow cannot be picked up as item by the player until the block in front of the dispenser is removed. This is different to the behaviour of all other blocks where the arrow can be picked up.

      The reason

      The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

      The reason for this is that the method net.minecraft.entity.projectile.EntityArrow.onHit(RayTraceResult) sets the position of the arrow to NaN, NaN, NaN because

      1. raytraceResultIn.hitVec.xCoord - this.posX = 0 (for y and z as well)
      2. MathHelper.sqrt_double(0, 0, 0) = 0 (= f2)
      3. this.motionX / (double)f2 * 0.05000000074505806D; = NaN

      This causes the bounding box to be invalid as well. This cannot be seen in the NBT data because the method net.minecraft.world.World.updateEntityWithOptionalForce(Entity, boolean) sets the position to previous if it is either NaN or Infinite, however it does not correct the bounding box. Changing the onHit method which causes this first would probably be the better choice.


      16w03a: Code deobfuscated by Mario Welzig

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: