Skip to content

Configuration Guide

Joshua edited this page Feb 15, 2025 · 1 revision

PhantomBan Configuration Guide

Main Configuration File (config.yml)

The main configuration file is located at plugins/PhantomBan/config.yml. This file controls all aspects of the plugin's behavior.

Data Section


    data:
      blacklist: []
    
  • blacklist: A list of player usernames that are exempt from phantom-banning. Players on this list will not be affected by PhantomBan, and will not be allowed connection by PhantomBan and will be treated as if they were still banned.

Settings Section

This section allows you to customize the core functionalities of PhantomBan.

Blacklist Settings


    settings:
      blacklist-enabled: true
    
  • blacklist-enabled: When set to true, the plugin will check the blacklist and exempt those players from phantom-banning.

Loyalty Rewards

Encourage phantom-banned players to spend time on the server to reduce their ban duration.


    loyalty-rewards:
      enabled: true
      seconds-until-unban: 1800
      commands-to-run:
        - "unban %1$s"
        - 'minecraft:tellraw %1$s ["§aYou have completed your sentence and may re-connect to rejoin society! Thank you for your service."]'
    
  • enabled: Enables or disables the loyalty rewards system.
  • seconds-until-unban: The number of seconds a phantom-banned player must stay online before being automatically unbanned.
  • commands-to-run: A list of commands executed when the player qualifies for unbanning. The placeholder %1$s is replaced with the player's username.

Effects and Events

Define how phantom-banned players are restricted and what messages they receive.


    effects:
      invisibility: true
      events:
        org.bukkit.event.player.PlayerJoinEvent:
          enabled: true
          message: "&cYou have joined the server while &bphantom-banned&c. Your ban will be reduced by playing."
        org.bukkit.event.player.AsyncPlayerChatEvent:
          enabled: true
          message: "&cYou cannot chat while &bphantom-banned&c. &6%1$s"
        org.bukkit.event.player.PlayerCommandPreprocessEvent:
          enabled: true
          message: "&cYou cannot use commands while &bphantom-banned&c. &6%1$s"
        org.bukkit.event.player.PlayerDropItemEvent:
          enabled: true
          message: "&cYou cannot drop items while &bphantom-banned&c. &6%1$s"
        org.bukkit.event.entity.EntityDamageByEntityEvent:
          enabled: true
          message: "&cYou cannot damage entities while &bphantom-banned&c. &6%1$s"
        org.bukkit.event.player.PlayerInteractEvent:
          enabled: true
          message: "&cYou cannot interact with items while &bphantom-banned&c. &6%1$s"
    
  • invisibility: When true, makes phantom-banned players invisible to others.

  • events: A list of Bukkit events to restrict for phantom-banned players.

  • Event Path: The fully qualified class name of the Bukkit event.

  • Example: org.bukkit.event.player.AsyncPlayerChatEvent

  • Event Configuration:

  • enabled: Enables or disables the restriction for this event.

  • message: The message sent to the player when they attempt the restricted action. You can use %1$s as a placeholder for dynamic content, such as time remaining until unban.

  • Note: You can use any Bukkit event in this section as long as you provide the correct class path name. This allows for extensive customization of player restrictions based on events.

Messages Section

Customize messages sent to players and staff.


    messages:
      help:
        - "&6/phantomban &ehelp &7- &aDisplay this message"
        - "&6/phantomban &eadd  &7- &aAdd a player to the blacklist"
        - "&6/phantomban &eremove  &7- &aRemove a player from the blacklist"
        - "&6/phantomban &ereload &7- &aReloads the config and event listeners"
      notification: "&ePlayer &c%1$s &ehas joined while &bphantom-banned&e."
      reload-success: "&eSuccessfully reloaded config. Please check to see if event listeners successfully fire."
      reload-failure: "&cFailed to reload config. Plugin has been &c&ldisabled&c - Check console and restart."
      remove-success: "&eSuccessfully removed data from blacklist."
      remove-failure: "&cFailed to remove data from blacklist. &eMaybe it has already been removed?"
      add-success: "&eSuccessfully added data to blacklist."
      add-failure: "&cFailed to add data to blacklist. &eMaybe it already exists?"
      time-until-unban: "You have %1$s seconds left until unbanned."
    
  • help: The list of help messages displayed when a player uses /phantomban help.
  • notification: Message sent to staff members when a phantom-banned player joins the server.
  • reload-success and reload-failure: Messages indicating the result of a configuration reload.
  • remove-success and remove-failure, add-success and add-failure: Feedback messages for modifying the blacklist.
  • time-until-unban: Message showing the remaining time until the phantom-ban is lifted.

Clone this wiki locally