BedrioxDOCUMENTATION
PLUGIN DEVELOPMENT

Gameplay patterns

A complete feature usually crosses several APIs. Keep each boundary small and let Bedriox remain authoritative.

A PvP arena flow

  1. A typed /arena join <name> command records the player's intent.
  2. Resolve the player and arena world, then teleport through the Player API.
  3. Schedule a countdown and show each tick through a popup or title.
  4. Listen for combat, death, disconnect, and world-unload events.
  5. Track only UUIDs and plugin-owned arena state—not internal player objects.
  6. Award immutable item stacks through a fresh inventory handle.
  7. Cancel timers, release containers, and clear arena state during shutdown.

Async boundary

Use async work only for computation or external I/O that does not touch live Bedriox objects. Return a small data result to scheduled main-thread work, resolve current players/worlds/entities again, validate that the match is still active, and only then request mutations.