Sueta

TogglePotions

1.01

A simple way to toggle any potion effect!

·Plugin


A simple, easy way to toggle any level of any potion effect. A great perk for ranks & more!

Usage

With TogglePotions, a player can turn on or off any potion effect. They must have the togglepotions.[potion name].[level] permission in order to use it, or the togglepotions.[potion name].*

For example, /toggle speed 10 would give the user speed 10 for an infinite (or close enough!) amount of time.

If a player already has a potion effect (speed 2), and tries to toggle on a higher level (speed 10), the player will receive the higher level version.

All messages can be configured and you can choose to have the output displayed to players either in the action bar, to remove chat clutter, or in the chat.

messages:
  # If false, will send messages to chat
  actionBar: true

  invalidPotionInput: "&bTogglePotions &8&l> &7You entered an invalid potion name."
  invalidNumberInput: "&bTogglePotions &8&l> &7You entered an invalid potion level."
  noPermission: "&bTogglePotions &8&l> &7You don't have permission to do this."
  reloaded: "&bTogglePotions &8&l> &7Config has been reloaded."
  usage: "&bTogglePotions &8&l> &7Proper usage: /toggle [potion] [<level=0>]"
  toggledOn: "&bTogglePotions &8&l> &7Potion effect has been toggled on."
  toggledOff: "&bTogglePotions &8&l> &7Potion effect has been toggled off."

sounds:
  enable: true
  toggleOn:
    sound: "BLOCK_NOTE_HARP"
    volume: 1
    pitch: 1
  toggleOff:
    sound: "BLOCK_NOTE_HARP"
    volume: 1
    pitch: 0

Alias System

By default, TogglePotions accepts both vanilla potion names (without spaces) and spigot enum names when toggling potions. You can add your own aliases in the potionMap configuration file.

The file follows an [ALIAS]|[POTION EFFECT TYPE] format.
Example: HELLO|WATER_BREATHING would allow users to get the water breathing potion effect when using /toggle hello. For a full list of valid potion effect types, click here.

Commands

  • /toggle [potion name] [level]
    • Aliases: /togglepotion, /tpot
    • If no level is provided, it will default to a level of 1.
  • /toggle reload
    • reloads the config and potion aliases

Permissions

All permissions should be in lower case
Valid potion effect types

  • togglepotions.use - required to use toggle any potion effect.
  • togglepotions.reload - required to reload the config.
  • togglepotions.[potion effect type].[level] - required to toggle a potion effect type at a specific level
  • togglepotions.[potion effect type].* - allows a user to toggle a potion effect type at any level (use with caution)
  • togglepotions.all.[level] - allows a user to toggle any potion effect at a certain level (use with caution)
  • togglepotions.all.* - allows a user to toggle any potion effect at any level

Similar projects

Plugin →