Files
core-minigames/docs/FullTutorialExamples/KingOfHill/02-minigame-definition.md
T
HeruEdhel 49bbd2b871 feat: Enhance minigame effects and UI interactions
- Implemented LeaveMinigameQueueEffect to handle player removal from queues and runtime.
- Added OpenMinigameQueueUIEffect to manage the opening of the minigame queue UI.
- Introduced StartPlayerTimerEffect and StopPlayerTimerEffect for managing player timers and scoring.
- Enhanced PlaceBlocksEffect with options for filling volumes and hollow placements.
- Updated SpawnItemEffect to fix codec handling for item IDs.
- Added MountPlayerEffect and DismountPlayerEffect for player interactions with NPCs.
- Improved StartQueuedMinigameEffect to check player counts before starting games.
- Added localization entries for new effects and UI elements.
- Updated manifest to include HyUI as a dependency.
2026-06-11 17:17:54 -07:00

2.6 KiB

King of the Hill — Minigame Definition

Create the following file in your server's assets:

src/main/resources/Server/Minigames/King_Of_The_Hill.json
{
  "Id": "King_Of_The_Hill",
  "Name": "King of the Hill",
  "Enabled": true,
  "MinPlayers": 2,
  "MaxPlayers": 16,
  "TeamMode": "SOLO",
  "WinCondition": "HIGHEST_SCORE",
  "RoundLengthSeconds": 120,
  "TotalRounds": 3,
  "CountdownSeconds": 10,
  "AllowPvp": true,
  "RequiredGameMode": "Adventure",
  "ShowHud": true,
  "ShowScore": true,
  "ShowTime": true,
  "ShowRound": true
}

Field Breakdown

Field Value Why
Id King_Of_The_Hill Must match the filename exactly and all MinigameId fields on every trigger volume in the world.
MinPlayers 2 Queue will not start a countdown until at least 2 players have joined. Set to 1 for solo testing.
TeamMode SOLO Each player competes individually with their own score.
WinCondition HIGHEST_SCORE The player with the most points when the game ends wins.
RoundLengthSeconds 120 Each hill is active for 2 minutes before the next round begins.
TotalRounds 3 Three rounds run in sequence. The runtime advances rounds automatically when each timer expires.
CountdownSeconds 10 After MinPlayers has joined the queue, a 10-second countdown begins before the game starts.
AllowPvp true Players can knock each other off the hill. Set to false for a passive score-race version.
RequiredGameMode Adventure Applied to each player when they activate. Prevents block breaking and placing.
ShowHud true Enables the in-game HUD. Without this, no HUD appears even if the other Show* fields are set.
ShowScore true Shows the player's current score on the HUD.
ShowTime true Shows time remaining in the current round on the HUD. Only renders when RoundLengthSeconds > 0.
ShowRound true Shows current round out of total rounds (e.g. 2 / 3). Only renders when TotalRounds > 1.

How Rounds Work

You do not need to manually advance rounds. The runtime handles this automatically:

  1. When the game starts, the $round timer begins counting down RoundLengthSeconds for round 1.
  2. When the timer expires, round 2 starts and the timer resets.
  3. When round 3's timer expires, on_game_rounds_complete is dispatched.

Your trigger volumes use the CurrentRound condition to check which round is active, so each capture zone automatically becomes active or inactive as rounds change.

Testing With One Player

Change MinPlayers to 1 while setting up and testing your world. Change it back before going live.