Skip to content

Events Cooldowns and Tasks

Reece Williams edited this page Sep 2, 2026 · 2 revisions

Events, Cooldowns and Tasks

The grab-bag of gameplay listeners, item cooldowns, and repeating tasks in ServerTools. Everything here lives in config.yml under Events:, Cooldowns:, Misc:, Disabled:, or a couple top-level keys.

Requires: none for most. Withdraw requires Vault (@RequiresPlugin({"Vault"})).

Each feature below has its real behavior, config path, whether it ships enabled, and the perms/options that matter. A few pull from companion .yml files (AntiCraft.yml, Announcements.yml, ScheduledTask.yml) that get generated on first run.

Events

AntiCraft

Blocks crafting or using stations (anvil, smithing table, grindstone, enchanting) for specific items, unless the player has the bypass perm.

  • Config: Events.AntiCraft
  • Enabled by default: no
  • Companion file: AntiCraft.yml holds the actual block lists (unknown materials get skipped with a console warning)
  • Per-station toggles: Crafting, Anvil, Smithing, Grindstone, Enchanting (all true)
  • Perms: AdminPerm (anticraft.admin), Bypass (anticraft.bypass)
  • MSG supports %action% and %item%

StackUnstackables

Lets normally unstackable items stack. You give it a list of material names.

  • Config: Events.StackUnstackables
  • Enabled by default: no
  • items: list, e.g. SADDLE, SHEARS, EGG

WorldEffects

Applies a permanent potion effect to everyone in a given world.

  • Config: Events.WorldEffects
  • Enabled by default: yes
  • worlds: entries use the format world:EFFECT:level, e.g. world:NIGHT_VISION:1

OnJoinCommands

Runs console commands when a player joins. Two buckets: first-ever unique join, and every join.

  • Config: Misc.OnJoinCommands
  • Enabled by default: no
  • FirstUniqueJoin.CMDS runs once per player, PlayerRunCommands.CMDS runs every join
  • %player% gets substituted in each command

Withdraw

Console-driven. /withdraw AMOUNT player pulls money out of the player's Vault balance and hands them a paper "note" item worth that amount. Players can also /withdraw <amount / all> on themselves.

  • Config: Misc.Withdraw
  • Enabled by default: no
  • Requires Vault. The class is tagged @RequiresPlugin({"Vault"}) and calls econ.withdrawPlayer(...), so no Vault means no Withdraw.

XPBottle

/xpbottle <amount / all> converts a player's experience into bottle items, and drinking those bottles gives the XP back. Purely XP, nothing to do with money or economy.

  • Config: Misc.XPBottle
  • Enabled by default: no
  • Uses Util.setTotalExperience and EXPERIENCE_BOTTLE items only, never touches Vault or balances.

DeathCooldown

Currently inactive. The class exists but its constructor and config reads are commented out, so there's no live config.yml section for it.

NoBedExplosionInNether

Stops beds from blowing up when used in the Nether/End.

  • Config: Events.NoBedExplosionInNether
  • Enabled by default: yes

CMDAliases

The big one. Custom command aliases plus a few command-gating tricks.

  • Config: Misc.CMDAliases
  • Enabled by default: yes
  • Bypass perm: cmdalias.bypass
  • cmds: maps a short alias to the real command, e.g. colors -> essentials:info colors
  • disabled: blocks commands outright (things like pl, plugins, version, bukkit:*)
  • preCooldownCommands: delays a command by N seconds using command%seconds syntax, e.g. spawn%5. stopIfMoved: false controls whether moving cancels it
  • disabledWorlds: blocks specific commands per world name, e.g. no sethome in spawn or Warzone

Cooldowns

All three sit under Cooldowns: and share Seconds plus message strings. %timeleft% shows remaining time.

EnderPearlCooldown

Rate-limits throwing ender pearls.

  • Config: Cooldowns.EnderPearlCooldown
  • Enabled by default: no
  • Options: Seconds (15), Message

GoldenAppleCooldown

Cooldown on eating regular golden apples (GOLDEN_APPLE data 0).

  • Config: Cooldowns.GoldenAppleCooldown
  • Enabled by default: no
  • Options: Seconds (15), Message, StartCooldownMSG (supports %seconds%)

GodAppleCooldown

Same deal for enchanted god apples (GOLDEN_APPLE data 1).

  • Config: Cooldowns.GodAppleCooldown
  • Enabled by default: no
  • Options: Seconds (45), Message, StartCooldownMSG

Both apple cooldowns extend a shared ConsumeCooldown base class, which reads Seconds / Message / StartCooldownMSG off whatever section it's handed.

Tasks

These are the repeating / scheduled runnables.

AutoBroadcast

Broadcasts messages on a timer, cycling through what's defined in Announcements.yml.

  • Config: AutoBroadcast (top level)
  • Enabled by default: yes
  • Companion file: Announcements.yml (auto-created; needs a Messages section or it warns in console)

ClearLag

Auto-clears ground items (and optionally mobs) on a repeating timer, with a warning message before it fires.

  • Config: Misc.ClearLag
  • Enabled by default: no (but the nested AutoClearItems.Enabled is true)
  • Options: ClearMobs (true), ClearDelay in seconds (900), ClearSoonMSG, ClearedMSG
  • Manual perm: tools.clearlag

Launchpads

Stand on a pressure plate sitting on an emerald block and get launched into the air. A runnable checks for players on plates.

  • Config: Events.Launchpads
  • Enabled by default: yes
  • Options: BlockType (EMERALD_BLOCK), PlateType (STONE_PRESSURE_PLATE), LaunchPower (1), RunnableTicksperCheck (7)
  • Admin perm: launchpad.admin

ScheduledTask

Runs tasks defined in ScheduledTask.yml on a schedule.

  • Config: Misc.ScheduledTask
  • Enabled by default: no
  • Companion file: ScheduledTask.yml (auto-created)
  • Options: Debug (false), Permission (tools.scheduledtask.admin)

DisableTimeChange (TimeChange)

Not really a toggle-off, more a time controller. It locks configured worlds to day or night and re-syncs on an interval.

  • Config: Disabled.DisableTimeChange
  • Enabled by default: yes
  • Options: DayInAllWorlds (true), SecondSync in seconds (60), DayWorlds: list, NightWorlds: list

Clone this wiki locally