Class PotionUtils

java.lang.Object
org.skriptlang.skript.bukkit.potion.util.PotionUtils

public final class PotionUtils extends Object
  • Field Details

  • Constructor Details

    • PotionUtils

      public PotionUtils()
  • Method Details

    • getPotionEffects

      public static List<org.bukkit.potion.PotionEffect> getPotionEffects(ItemType itemType)
      Attempts to retrieve a list of potion effects from an ItemType.
      Parameters:
      itemType - The ItemType to get potion effects from.
      Returns:
      A list of potion effects from an ItemType, if any were found.
    • addPotionEffects

      public static void addPotionEffects(ItemType itemType, org.bukkit.potion.PotionEffect... potionEffects)
      Adds potions effects to an ItemType.
      Parameters:
      itemType - The ItemType to modify.
      potionEffects - The potion effects to add.
    • removePotionEffects

      public static void removePotionEffects(ItemType itemType, org.bukkit.potion.PotionEffectType... potionEffectTypes)
      Removes potions effects from an ItemType.
      Parameters:
      itemType - The ItemType to modify.
      potionEffectTypes - The potion effects to remove.
    • clearPotionEffects

      public static void clearPotionEffects(ItemType itemType)
      Removes all potion effects from the ItemType's meta.
      Parameters:
      itemType - The ItemType to modify.
    • getHiddenEffects

      public static Deque<org.bukkit.potion.PotionEffect> getHiddenEffects(org.bukkit.potion.PotionEffect effect)
      A utility method to obtain the hidden effects of a potion effect.
      Parameters:
      effect - The effect to obtain hidden effects from.
      Returns:
      A deque of the hidden effects of effect ordered from most hidden to least hidden.