Compatibility
Minecraft: Java Edition
Platforms
Tags
Creators
Details
EVENT PHASE SYSTEM (BACKEND OVERVIEW)
PURPOSE:
Allows a Paper plugin event system to execute console commands at timed intervals after /event start.
SUMMARY
- Event starts
- Players teleported
- Phases loaded from config
- Each phase scheduled using Bukkit scheduler
- Console commands executed at defined ticks
CONFIG STRUCTURE (config.yml)
start: phases: - after: <ticks> commands: - "command 1" - "command 2"
- after: <ticks>
commands:
- "command 3"
NOTES:
- phases is a LIST (not a map)
- each entry is an independent timed phase
- after = delay in ticks from event start
- commands = list of console commands
ADMIN COMMANDS
-
SET CENTER POSITION /event cornucopia center
- Sets the center of the circle to the player's current location
- This is the origin point for all spawn calculations
-
SET RADIUS /event cornucopia radius <number>
Example: /event cornucopia radius 15
- Controls distance from center to each spawn point
- Larger radius = more spread out players
- Smaller radius = tighter cornucopia
-
ENABLE AUTO MODE /event mode auto
- Switches spawn system from manual coordinates to generated circle spawns
- Required for cornucopia system to activate
/event mode manual
- Disables circle generation and uses saved spawn points instead
- START EVENT
/event start
BEHAVIOR:
- Counts online players
- Generates N evenly spaced points on a circle
- Teleports each player to a unique position
- Spawns are distributed using angular spacing
BACKEND
-
Player runs: /event start
-
EventManager.startEvent() executes:
- Teleports players (manual or auto circle)
- Calls runStartPhases()
-
runStartPhases():
FOR each phase in config "start.phases":
read: delay = phase.after commands = phase.commands schedule task: BukkitScheduler.runTaskLater(plugin, task, delay) -
When delay expires:
FOR each command in phase.commands: Bukkit.dispatchCommand(CONSOLE, command)
SCHEDULING BEHAVIOR
Example:
phase A: after: 1 commands: - "pvp disable"
phase B: after: 20 commands: - "say Event started"
RESULT:
tick 1 -> pvp disabled tick 20 -> message broadcast
IMPORTANT:
- delays are relative to EVENT START
- phases do NOT chain automatically
- each phase schedules independently
COMMON ERRORS FIXED
WRONG (invalid YAML): start: phases: after: 1 commands: after: 20 commands:
CAUSE:
- duplicate keys
- not a list structure
CORRECT EXAMPLE: start: phases: - after: 1 commands: - "clear" - after: 20 commands: - "say This is 1 second after the event start!"


