Class HUNGER


public class HUNGER extends PotionEffectSuper
Hunger potion effect that increases the target player's hunger and food depletion.

HUNGER applies Minecraft's HUNGER potion effect to increase the target player's hunger level and cause them to deplete food faster while active. The effect is powered by the Minecraft potion effect system with strength (amplifier) set to 1, determining the hunger intensity. The effect is detectable by mind-reading spells (Legilimens) and information spells (Informous) which report the target "is hungry". The player receives an affectation notification of "You feel hungry." when the effect is applied.

See Also:
  • Constructor Details

    • HUNGER

      public HUNGER(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid)
      Constructor for creating a hunger potion effect.

      Creates a potion effect that causes hunger and accelerated food depletion to the target player using Minecraft's HUNGER potion effect type. The effect is detected by information spells as the target "is hungry" and notifies the player "You feel hungry."

      Parameters:
      plugin - a callback to the MC plugin
      duration - the duration in ticks, snapped to min of 2 minutes, max of 5 minutes
      isPermanent - ignored - potion effects cannot be permanent
      pid - the unique ID of the player to afflict with hunger
  • Method Details

    • doRemove

      public void doRemove()
      Perform cleanup when the hunger effect is removed.

      The default implementation does nothing, as HUNGER is a potion effect whose effects are automatically managed by the Minecraft potion system. When the effect expires or is manually removed, the player's hunger depletion rate returns to normal.

      Specified by:
      doRemove in class O2Effect