Legacy potion API

Potion

The Potion class provides a legacy interface for applying potion effects. For new code, prefer using Effect directly.


Class Methods

apply

await Potion.apply(player, effect_type=None, duration=0, amplifier=0, ambient=False, particles=True, icon=True)

Apply a potion effect to a player. This is functionally identical to Effect.apply.

await Potion.apply(player, "POISON", duration=100, amplifier=0)

Attributes

type

The potion's effect type.

level

The potion level.


Recommendation

Use Effect for all new code:

# Preferred
await Effect.apply(player, "SPEED", duration=600, amplifier=1)

# Legacy (still works)
await Potion.apply(player, "SPEED", duration=600, amplifier=1)

Both are equivalent, but Effect provides additional methods like with_duration() and with_amplifier().