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.
[SPIGOT-7025] Bug with getting persistent data container
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Remote Link | New: Esta incidencia está enlazada a "MC-127321 (Enchanted tridents not working for drowned) (Enlace Web)" [ 10201 ] |