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

No EntityPotionEffectEvent.Cause for Warden

XMLWordPrintable

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

    • CraftBukkit version 3537-Spigot-56be6a8-622dbe6 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT)
    • Yes

      The darkness status effect applied by the warden does not have a cause in the EntityPotionEffectEvent.Cause enum, causing UNKNOWN to be used when the event is called for this action.

      If you're not familiar, the warden doesn't apply the darkness effect when attacking, it just gives darkness periodically to all players in range, so this does not fall under the ATTACK enum value.

      I tested to ensure no cause was being assigned using this code:

      @EventHandler
      public void onEffect(EntityPotionEffectEvent e) {
          getLogger().info("potion applied by " + e.getCause());
      } 

      A compiled version of this code is attached. It outputs "potion applied by UNKNOWN" when the warden gives darkness. When this test plugin is installed, this message can be observed by:

      1. Ensure you are in survival mode ( /gamemode survival), and on a difficulty other than peaceful ( /difficulty easy).
      2. Run "/summon warden" or use a Warden Spawn Egg to spawn a warden.
      3. Stand near the warden and wait for it to give you the darkness effect.
      4. Observe "potion applied by UNKNOWN" message in console.

      This issue does not apply to Spigot or Vanilla versions under 1.19, since the warden was added in 1.19. This issue does not apply to Vanilla at all, since this is a Bukkit API issue. This bug only applies to Bukkit 1.19.

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

              Created:
              Updated:
              Resolved: