Package org.bukkit.potion
Interface PotionBrewer
public interface PotionBrewer
Represents a brewer that can create
PotionEffect
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPotionMix
(PotionMix potionMix) Adds a new potion mix recipe.createEffect
(@NotNull PotionEffectType potion, int duration, int amplifier) Creates aPotionEffect
from the givenPotionEffectType
, applying duration modifiers and checks.getEffects
(@NotNull PotionType type, boolean upgraded, boolean extended) Deprecated.getEffectsFromDamage
(int damage) Deprecated.Non-Functionalvoid
Removes a potion mix recipe.void
Resets potion mixes to their default, removing all custom ones.
-
Method Details
-
createEffect
@NotNull @NotNull PotionEffect createEffect(@NotNull @NotNull PotionEffectType potion, int duration, int amplifier) Creates aPotionEffect
from the givenPotionEffectType
, applying duration modifiers and checks.- Parameters:
potion
- The type of potionduration
- The duration in ticksamplifier
- The amplifier of the effect- Returns:
- The resulting potion effect
-
getEffectsFromDamage
Deprecated.Non-FunctionalReturns a collection ofPotionEffect
that would be applied from a potion with the given data value.- Parameters:
damage
- The data value of the potion- Returns:
- The list of effects
-
getEffects
@NotNull @Deprecated @NotNull Collection<PotionEffect> getEffects(@NotNull @NotNull PotionType type, boolean upgraded, boolean extended) Deprecated.Upgraded / extended potions are now their ownPotionType
usePotionType.getPotionEffects()
insteadReturns a collection ofPotionEffect
that would be applied from a potion with the given type.- Parameters:
type
- The type of the potionupgraded
- Whether the potion is upgradedextended
- Whether the potion is extended- Returns:
- The list of effects
-
addPotionMix
Adds a new potion mix recipe.- Parameters:
potionMix
- the potion mix to add
-
removePotionMix
Removes a potion mix recipe.- Parameters:
key
- the key of the mix to remove
-
resetPotionMixes
void resetPotionMixes()Resets potion mixes to their default, removing all custom ones.
-
PotionType
usePotionType.getPotionEffects()
instead