Class ANIMAGUS_POTION

java.lang.Object
net.pottercraft.ollivanders2.potion.O2Potion
net.pottercraft.ollivanders2.potion.ANIMAGUS_POTION

public final class ANIMAGUS_POTION extends O2Potion
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.

  • Constructor Details

    • ANIMAGUS_POTION

      public ANIMAGUS_POTION(@NotNull @NotNull Ollivanders2 plugin)
      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
      Specified by:
      drink in class O2Potion
      Parameters:
      player - the player who drank the potion
    • getPotionFailureMessage

      public String getPotionFailureMessage()
      Get the failure message to the drinker if this potion did not work.
      Returns:
      the failure message
    • getAlreadyAnimagusMessage

      public String getAlreadyAnimagusMessage()
      Get the messagr to send to the drinker if they are already an animagus
      Returns:
      the already an animagus message