Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3013

EntityDamageByEntityEvent -> Projectile.getLocation()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • Tested on last spigot-1.11.2  & spigot-1.10.2

       

       

      Using EntityDamageByEntityEvent -> Projectile.getLocation() does not return the correct location of the arrow.

      The location returned by the method is somewhere in front of the target, and it "seems" like is affected by the velocity.

      The (easiest) way to reproduce:

      • Create a NPC (Citizens)  
      • Move away from him only on X (or Z)
      • Shoot an arrow in the head
      • The Projectile.getLocation() will return a X value somewhere between you and the NPC (rather than the X of the NPC <>1). Depending on the speed and distance I shoot from, I can even get dx > 3  blocks.

      This can be replicated on Y as well:

      If you place the NPC 2-3 blocks above you, and you shoot the legs,  you will get a Y smaller than the NPC location.

      .............................

      Either the method returns the 'end' of the arrow (but this does not explain the variation between different tests), either in the moment  the method is recording the location, the arrow is still on flight.

            Unassigned Unassigned
            nidark nidark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: