Blocked potions
Choose potion effects players can’t have in combat. They’re taken away when combat starts and the time that was left is given back when combat ends.
Settings
These are under potion-blocking: in config.yml. This is the default:
potion-blocking:
effects:
- INVISIBILITY
# What happens when a player in combat uses a potion with one of these effects.
# block: the potion can't be drunk or thrown and stays in the inventory.
# save: the potion works, but the blocked effects are saved and given after combat.
on-use: block| Setting | Meaning |
|---|---|
effects: | The effects that are blocked, by their Minecraft ID, for example INVISIBILITY, SPEED, STRENGTH, JUMP_BOOST or REGENERATION. INVISIBILITY by default. effects: [] turns blocking off. |
on-use: block | A potion with a blocked effect can’t be drunk or thrown in combat. The potion stays in the inventory and the player sees potion-blocked. |
on-use: save | The potion can be used, but its blocked effects are saved and only given after combat. |
How it works
- When combat starts, every blocked effect the player has is taken away and saved with its level and the time it had left. The player sees
potion-removed, for example “Removed Invisibility until combat ends.” - While they’re in combat, a blocked effect from anywhere else is never given: splash or lingering potions from other players, tipped arrows, beacons, conduits or other plugins. It’s saved instead.
- If the same effect is saved twice, the stronger one is kept, and for the same level the longer one.
- When combat ends by the timer, because every opponent died, or by
/combat remove, the saved effects are given back and the player seespotion-restored. - Nothing is given back after a death or after logging out in combat.
- Saved effects survive a server restart in
tags.yml. - Effects that last forever, for example from other plugins, come back as forever.
Unknown effect names
A name that isn’t a Minecraft effect is skipped and the console shows Unknown effect 'NAME' in potion-blocking. Use the effect ID with underscores, for example JUMP_BOOST.