Class ANIMAGUS_POTION
java.lang.Object
net.pottercraft.ollivanders2.potion.O2Potion
net.pottercraft.ollivanders2.potion.ANIMAGUS_POTION
Animagus Potion - transforms a player into their animal form.
This potion is consumed after successfully casting the Animagus incantation spell. When consumed, it transforms the player into their animal form and grants them the ANIMAGUS_EFFECT for permanent transformation ability without needing the potion.
Requirements for successful transformation:
- LibsDisguises plugin must be enabled
- Player must have recently cast the Animagus incantation (ANIMAGUS_INCANTATION effect)
- If useStrictAnimagusConditions is enabled, the transformation only works during thunderstorms
If the player is already an Animagus, drinking the potion has no effect but provides feedback that the potion tastes familiar.
-
Field Summary
Fields inherited from class net.pottercraft.ollivanders2.potion.O2Potion
duration, flavorText, ingredients, potionColor, potionSuccessMessage, potionType, text, usesModifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrink(@NotNull org.bukkit.entity.Player player) Drink the Animagus Potion and apply transformation effects.Get the messagr to send to the drinker if they are already an animagusGet the failure message to the drinker if this potion did not work.Methods inherited from class net.pottercraft.ollivanders2.potion.O2Potion
brew, brewBadPotion, checkRecipe, createPotionItemStack, getFlavorText, getIngredients, getIngredientsText, getLevel, getMagicBranch, getName, getPotionSuccessMessage, getPotionType, getText, setUsesModifier
-
Constructor Details
-
ANIMAGUS_POTION
Constructor- Parameters:
plugin- a callback to the plugin
-
-
Method Details
-
drink
public void drink(@NotNull @NotNull org.bukkit.entity.Player player) Drink the Animagus Potion and apply transformation effects.The behavior depends on several conditions:
- If LibsDisguises is disabled, the potion has no effect
- If the player is already an Animagus, the potion has no transformation effect
- If useStrictAnimagusConditions is enabled and it's not thundering, the potion has no effect
- If the player has the ANIMAGUS_INCANTATION effect, they are transformed into their animal form and granted the permanent ANIMAGUS_EFFECT
- If none of the above conditions are met, nothing happens
-
getPotionFailureMessage
Get the failure message to the drinker if this potion did not work.- Returns:
- the failure message
-
getAlreadyAnimagusMessage
Get the messagr to send to the drinker if they are already an animagus- Returns:
- the already an animagus message
-