Class PotionUtils
java.lang.Object
org.skriptlang.skript.bukkit.potion.util.PotionUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA string representation of aTimespanofDEFAULT_DURATION_TICKS.static final int30 seconds is the default length for the /effect command See https://minecraft.wiki/w/Commands/effect -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPotionEffects(ItemType itemType, org.bukkit.potion.PotionEffect... potionEffects) Adds potions effects to an ItemType.static voidclearPotionEffects(ItemType itemType) Removes all potion effects from the ItemType's meta.static Deque<org.bukkit.potion.PotionEffect> getHiddenEffects(org.bukkit.potion.PotionEffect effect) A utility method to obtain the hidden effects of a potion effect.static List<org.bukkit.potion.PotionEffect> getPotionEffects(ItemType itemType) Attempts to retrieve a list of potion effects from an ItemType.static voidremovePotionEffects(ItemType itemType, org.bukkit.potion.PotionEffectType... potionEffectTypes) Removes potions effects from an ItemType.
-
Field Details
-
DEFAULT_DURATION_TICKS
public static final int DEFAULT_DURATION_TICKS30 seconds is the default length for the /effect command See https://minecraft.wiki/w/Commands/effect- See Also:
-
DEFAULT_DURATION_STRING
A string representation of aTimespanofDEFAULT_DURATION_TICKS.
-
-
Constructor Details
-
PotionUtils
public PotionUtils()
-
-
Method Details
-
getPotionEffects
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
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
effectordered from most hidden to least hidden.
-