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

Addition: ProjectileHitEvent#getHitBlock

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None
    • None

      ProjectileHitEvent can now already return the hit entity if there is one.
      This ticket is asking for the similar addition of #getHitBlock(), which would return the hit block, or otherwise null if no block was hit (similar to how getHitEntity works).

      Minecraft is already determining the hit block for every projectile hit (as far as I can tell). Passing this to plugins via the event would allow them to not have to manually determine the hit block themselves, which potentially involves each plugin having to perform the necessary ray cast again.

      Ticket https://hub.spigotmc.org/jira/browse/SPIGOT-911 is asking for a similar addition, but for arrows only.

            Unassigned Unassigned
            blablubbabc blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: