• Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • CraftBukkit version 3465-Spigot-ffceeae-3ec79a2 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)
    • Yes

      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

          md_5 made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Doc made changes -
          Remote Link New: Esta incidencia está enlazada a "MC-127321 (Enchanted tridents not working for drowned) (Enlace Web)" [ 10201 ]
          David White created issue -

            Assignee:
            Unassigned
            Reporter:
            David White
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: