Guide

How to make a Minecraft minigame plugin

Updated October 18, 2026

A minigame plugin runs rounds: players wait in a lobby, a countdown starts, the game plays by its own rules, someone wins and the arena is reset for the next round. Every minigame, from spleef to bed wars, has the same skeleton. Get that right and the game rules are the easy part.

Start from this example and change the rules.

Generate this with Codexe

Step by step

  1. 1.Write the rules of one round

    How many players, how a round starts and ends, how someone wins, what happens on death (out, respawn, spectator) and what players get at the start.

  2. 2.Plan the arena setup

    Admin commands to create an arena and set its lobby, spawn points and borders, for example /mg create <name> and /mg setspawn <name>. Arenas are saved in a file so they survive restarts.

  3. 3.Define the game states

    Waiting, starting (countdown), playing and ending. Each state allows different things: nobody breaks blocks in the lobby, nobody joins a game in progress.

  4. 4.Decide how the arena resets

    Track and undo the blocks changed during the round, or reload a copy of a template world. Without a reset the second round starts on a broken map.

  5. 5.Add what players see

    A sidebar scoreboard with players left and time, a boss bar or titles for the countdown, and chat messages for kills and the winner.

  6. 6.Generate, build and play a round

    Describe it to Codexe, let it compile, then join the test server with Try it now. Set the minimum players low while testing so a round can start.

The game states

Most minigame bugs are players doing something in the wrong state. Writing the states in the request makes the AI build the plugin around them.

StateWhat happensTypical rules
WaitingPlayers join the lobbyNo damage, no block breaking, leave with an item or command
StartingCountdown once the minimum is reachedCountdown stops if players leave below the minimum
PlayingThe game rules applyNo joining, deaths eliminate or respawn, quitting counts as a loss
EndingWinner announced, rewards givenPlayers sent back after a few seconds, arena reset

Resetting the arena

  • Record and undo changes: save each block before it changes during the round and put it back at the end. Fast for small arenas where players break or place a few blocks.
  • Template world: keep a clean copy of the map, unload the played world after the round and copy the template over it. Simple and reliable for maps that get destroyed.
  • No changes allowed: for games like parkour or PvP duels, cancel block changes entirely and nothing needs resetting.

Example description

"A Paper 1.21.4 spleef minigame plugin. Admins create arenas with /spleef create <name>, /spleef setlobby and /spleef setfloor (the two corners of the snow floor). Players join with /spleef join <arena>. The round starts 15 seconds after 2 players are in, up to 8. Players get a diamond shovel, break snow instantly, and are out when they fall below the floor. Last player standing wins 50 coins via Vault. Eliminated players become spectators. The snow floor is restored after each round. Sidebar with players left and time. Arenas saved in arenas.yml, minimum players and rewards in config.yml."

Testing a minigame

A minigame is hard to judge from the code: you have to play a round. Try it now starts a private Paper server of your version with the plugin installed, usually in a flat world, and friends can join if you add them to Server Access. The free plan allows 2 people on a test server, Pro 5, Business 10 and Enterprise 20.

Ask for the minimum players in config.yml so you can set it to 1 or 2 while testing. Test players can also join, run the join and admin commands and check the messages, which catches broken commands before you play.

Questions

One arena or many?

Ask for multiple arenas from the start. Turning a single-arena plugin into a multi-arena one later means rewriting how players and game state are stored.

Can I make a 1.8 PvP minigame?

Yes. Say Spigot or Paper 1.8.8 in the request: Codexe writes the code for that older API, and test servers run versions from 1.8 to 26.3.

How do minigame networks work?

Large networks run each game on its own server behind a BungeeCord or Velocity proxy, with a lobby server that sends players to a free game. That is a proxy plugin plus a game plugin, as two projects.

Build your minigame

This prompt opens ready to send:

“A Paper 1.21.4 spleef minigame plugin: arenas created with /spleef create, setlobby and setfloor, players join with /spleef join, round starts 15 seconds after 2 players (max 8), diamond shovels, out when falling below the floor, last player wins 50 coins via Vault, spectators for eliminated players, snow floor restored after each round, sidebar with players left and time, arenas saved in arenas.yml.”

Generate this with Codexe
How to make a Minecraft minigame plugin | Codexe