When an entity (other than a player) throws a projectile and you try to get the items PDC in projectile launch event it does not return it.
@EventHandler public void onShoot(ProjectileLaunchEvent e) { if (e.getEntityType() == EntityType.TRIDENT && e.getEntity().getShooter() instanceof LivingEntity && ((Trident) e.getEntity()).getItem().getItemMeta().getPersistentDataContainer().has(nameKey, PersistentDataType.BYTE)) Bukkit.broadcastMessage("Thrown"); }
I have only tested this with tridents, but if a player throws it the server broadcasts the message, and if a drowned throws the same exact trident it does not.