[SPIGOT-7968] ProjectileHitEvent not trigerred when Projectile hits entity Created: 28/Nov/24  Updated: 25/Dec/24  Resolved: 30/Nov/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ssomar Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Attachments: File TestBukkit.jar    
Version: This server is running CraftBukkit version 4394-Spigot-60c9969-2b9a094
Guidelines Read: Yes

 Description   

Hello the ProjectileHitEvent is not triggered when the projectile hit an entity.
It works fine for blocks.

Small testing plugin attached with the following method.

@EventHandler
    public void onProjectileHitEvent(ProjectileHitEvent e) {
        Entity projectile = e.getEntity();
        Entity target;

        Bukkit.getServer().getConsoleSender().sendMessage("ProjectileHitEvent");

        if ((target = e.getHitEntity()) != null && !(target instanceof Player)) {
            Bukkit.getServer().getConsoleSender().sendMessage("ProjectileHitEvent: HitEntity");
        }

    }

Generated at Sun Mar 30 02:41:48 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.