Мова

Event Plugin

Event Plugin

Modrinth

This system lets you define multiple timed “event phases” in the config where each phase runs console commands after a specified number of ticks from the event starting.

9 завантажень 1 підписників оновлено 19d ago
Modrinth
Paper 26.1 – 26.1.2 ManagementUtility

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:
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


  1. 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

  1. SET RADIUS
    /event cornucopia radius

    Example:
    /event cornucopia radius 15

    • Controls distance from center to each spawn point
    • Larger radius = more spread out players
    • Smaller radius = tighter cornucopia

  1. 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

  1. 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


  1. Player runs:
    /event start

  2. EventManager.startEvent() executes:

    • Teleports players (manual or auto circle)
    • Calls runStartPhases()
  3. runStartPhases():

    FOR each phase in config "start.phases":

    read:
        delay = phase.after
        commands = phase.commands
    
    schedule task:
        BukkitScheduler.runTaskLater(plugin, task, delay)
    
  4. 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!"

Версії

Історія версій недоступна. Натисни «Завантажити», щоб отримати останню версію з джерела.

Коментарі 0

Поки немає коментарів. Будь першим, хто поділиться думкою.

Завантажити Event Plugin

Файли надаються напряму з першоджерела. Modgrid не зберігає та не змінює їх.