Package ch.njol.skript.util
Class PotionEffectUtils
java.lang.Object
ch.njol.skript.util.PotionEffectUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEffects(ItemType itemType, Object[] effects) Add PotionEffects to an ItemTyestatic voidaddEffects(org.bukkit.entity.LivingEntity entity, Object[] effects) Add PotionEffects to an entitystatic @Nullable org.bukkit.potion.PotionTypecheckPotionType(String name) Deprecated, for removal: This API element is subject to removal in a future version.To be removed in a future version.static voidclearAllEffects(ItemType itemType) Clear allPotionEffectsfrom an ItemTypestatic voidclearAllEffects(org.bukkit.entity.LivingEntity entity) Clear all the activePotionEffectsfrom an Entitystatic @Nullable org.bukkit.potion.PotionTypeeffectToType(org.bukkit.potion.PotionEffectType effect) Wrapper around deprecated API function, in case it gets removed.static List<org.bukkit.potion.PotionEffect> getEffects(ItemType itemType) Get all the PotionEffects of an ItemType This will also include the base potion as wellstatic ClassInfo<org.bukkit.potion.PotionEffectType> Legacy class info for PotionEffectType (pre-registry)static String[]getNames()static StringgetPotionName(@Nullable org.bukkit.potion.PotionEffectType effect, boolean extended, boolean strong) Get potion string representation.static @Nullable org.bukkit.potion.PotionEffectTypeparseByEffectType(org.bukkit.potion.PotionEffectType t) static @Nullable org.bukkit.potion.PotionEffectTypestatic voidremoveEffects(ItemType itemType, Object[] effects) Remove a PotionEffect from an ItemTypestatic voidremoveEffects(org.bukkit.entity.LivingEntity entity, Object[] effects) Remove a PotionEffect from an entitystatic StringtoString(org.bukkit.potion.PotionEffect potionEffect) static StringtoString(org.bukkit.potion.PotionEffectType t) static StringtoString(org.bukkit.potion.PotionEffectType t, int flags)
-
Method Details
-
parseType
-
parseByEffectType
@Nullable public static @Nullable org.bukkit.potion.PotionEffectType parseByEffectType(org.bukkit.potion.PotionEffectType t) -
toString
-
toString
-
toString
-
getNames
-
checkPotionType
@Nullable @Deprecated(since="2.8.5", forRemoval=true) public static @Nullable org.bukkit.potion.PotionType checkPotionType(String name) Deprecated, for removal: This API element is subject to removal in a future version.To be removed in a future version.Checks if given string represents a known potion type and returns that type. Unused currently, will be used soon (TM).- Parameters:
name- Name of potion type- Returns:
-
effectToType
@Nullable public static @Nullable org.bukkit.potion.PotionType effectToType(org.bukkit.potion.PotionEffectType effect) Wrapper around deprecated API function, in case it gets removed. Changing one method is easier that changing loads of them from different expressions.- Parameters:
effect- Type.- Returns:
- Potion type.
-
getPotionName
public static String getPotionName(@Nullable @Nullable org.bukkit.potion.PotionEffectType effect, boolean extended, boolean strong) Get potion string representation.- Parameters:
effect-extended-strong-- Returns:
-
clearAllEffects
public static void clearAllEffects(org.bukkit.entity.LivingEntity entity) Clear all the activePotionEffectsfrom an Entity- Parameters:
entity- Entity to clear effects for
-
addEffects
Add PotionEffects to an entity- Parameters:
entity- Entity to add effects toeffects-PotionEffectorPotionEffectTypeto add
-
removeEffects
Remove a PotionEffect from an entity- Parameters:
entity- Entity to remove effects foreffects-PotionEffectorPotionEffectTypeto remove
-
clearAllEffects
Clear allPotionEffectsfrom an ItemType- Parameters:
itemType- Item to remove effects from
-
addEffects
Add PotionEffects to an ItemTye- Parameters:
itemType- Item to add effects toeffects-PotionEffectorPotionEffectTypeto add
-
removeEffects
Remove a PotionEffect from an ItemType- Parameters:
itemType- Item to remove effects fromeffects-PotionEffectorPotionEffectTypeto remove
-
getEffects
Get all the PotionEffects of an ItemType This will also include the base potion as well- Parameters:
itemType- Item to get potions from- Returns:
- List of PotionEffects on the item
-
getLegacyClassInfo
Legacy class info for PotionEffectType (pre-registry)- Returns:
- ClassInfo for PotionEffeectType
-