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

Allays don't call EntityTargetEvent on ground items

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • N/a

    • 3539-Spigot-56be6a8-82f7574 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT)
    • Yes

      Allays don't call EntityTargetEvent when targeting items to pick up

          @EventHandler
          public void ontarger(EntityTargetEvent event) {
              
              Entity entity = event.getEntity();
              Entity target = event.getTarget();
              
              if(entity == null || target == null) return;
              
              Bukkit.broadcastMessage(entity.getType().name() + " " + target.getType().name());
              
          } 

      I am trying to prevent Allays from picking up certain items.
      canceling EntityPickupItemEvent just freezes them to that item and they don't loose focus of it.
      so my only other option is to prevent Targeting the item.
      This is when i noticed that it doesn't call the event.

            Doc Doc
            CoralPapa Coral_Papa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: