CraftThrownPotion getEffects() only returns customEffects

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • 4156-Spigot-e2c1eee-428aefe (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
    • Yes

      Pretty sure
       https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java#26

      should be 
       

      for (MobEffectInstance effect : this.getHandle().getItem().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).getAllEffects()) {

       

      @EventHandler
      public void onPotionSplash(PotionSplashEvent event) { 
      ThrownPotion potion = event.getPotion();
      Collection<PotionEffect> effects = event.getPotion().getEffects();
      Bukkit.broadcastMessage("Potion effects: " + effects.size());
      }

       
      Example code prints 0 when throwing a strength potion on the ground

            Assignee:
            Doc
            Reporter:
            Mersphydena
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: