Skip to content

Arena Detection & Player State

KOTL arenas are persistent game areas instead of timed match lobbies. A player’s membership is determined by whether their current location is inside a registered and enabled cuboid.


Configure detection under arena-schedulers:

arena-schedulers:
type: 1
interval: 2
async: false
TypeBehaviorRelevant Setting
1Checks all online players on a repeating task.interval controls the period in server ticks.
Any other valueChecks when PlayerMoveEvent crosses into a different block.interval is not used by the event listener.

The current implementation stores the async value with scheduler options, but the built-in general detector runs through the plugin scheduler.


An arena can detect a player only when:

  • It has been registered with ready: true.
  • It is currently enabled: true.
  • Both game area corners exist.
  • Both corners belong to the same loaded world.
  • The player’s location is inside the inclusive X, Y, and Z bounds.
  • PlayerEnterArenaEvent is not cancelled.

When entry succeeds, KOTL:

  • Saves the player’s inventory state.
  • Restores health to 20.
  • Optionally clears inventory contents.
  • Optionally removes active potion effects.
  • Applies the arena gamemode when one is configured.
  • Sets food level to 20.
  • Creates the arena scoreboard when global and arena toggles allow it.
  • Adds the configured boss bar when all three boss bar toggles allow it.
  • Restores an active king cooldown action bar when configured.

Walking outside the cuboid fires PlayerLeaveArenaEvent with AREA_EXIT, removes UI, restores the saved inventory, and saves statistics.

Other leave reasons include:

  • DEATH
  • KICK
  • DISCONNECT
  • ARENA_DELETED
  • ARENA_DISABLED
  • SERVER_RELOAD
  • SERVER_SHUTDOWN
  • STOP_COMMAND

When a player disconnects inside an arena, KOTL remembers that arena for the runtime. On reconnect, the player is teleported to its end location and their saved state is restored.


Inside a KOTL arena:

  • Inventory clicks are cancelled.
  • Block breaking and placement are cancelled.
  • Item dropping is cancelled.
  • Food-level changes are cancelled.
  • Fall damage can be cancelled.
  • Item and arrow pickup can be removed and cancelled.

Players in the same arena can hit each other and receive knockback, but KOTL sets direct damage to 0. Any attack that crosses the arena boundary or targets another KOTL arena is cancelled.


KOTL can isolate both directions of chat:

  • Arena chat can be limited to players in the same arena.
  • Messages sent outside games can be hidden from arena players.
  • Arena players can be prevented from sending chat entirely.
  • KOTL can replace the normal chat format with messages.yml chat-format.