Your first Minecraft plugin on Paper 26.3: from project to test server

You set up a Gradle project with Paper API 26.3 and Java 25, write a command and an event handler, and start a test server with one command. Following the PaperMC documentation, including what changed in 26.1.

What you will do

You will build a plugin that greets every player with a message from config.yml and has a /welcome command: a player sees their greeting, and an admin reloads the configuration without restarting the server. MiniMessage formats the messages, so colours and gradients go into the config as tags.

Version 26.1 changed how Paper is numbered. Before it the dependency looked like {VERSION}-R0.1-SNAPSHOT; now it is {VERSION}.build.{number}, and older tutorials online will not compile against the new API. This guide targets Paper 26.3.

Level
intermediate
Code
Java
Steps
7 steps
  1. Gradle Project Paper API 26.3 and Java 25.
  2. plugin.yml Plugin descriptor Name, main class, api-version.
  3. Java Command and event /welcome and a greeting on join.
  4. run-paper Test server Paper downloaded and started with one command.

What you need

  • JDK 25

    Paper 26.3 requires Java 25. Gradle picks the JDK through the toolchain, but you need Java on the machine to run Gradle itself.

  • Gradle or IntelliJ IDEA

    PaperMC recommends Gradle with the Kotlin DSL. In IntelliJ the Minecraft Development plugin creates the same project from a wizard.

  • A package name

    The package is your domain reversed plus the project name, for example com.example.welcome. Without a domain use io.github.yourname.

  • Accepting the Minecraft EULA

    The test server will not start until its owner accepts the EULA by setting eula=true in run/eula.txt. It is a legal decision for whoever runs the server, so do not automate it in a script.

Versions used in this guide

ItemVersionWhere from
Paper API26.3.build.157-betarepo.papermc.io
Java25toolchain in build.gradle.kts
Gradle9.8.0the gradle:9.8.0-jdk25 image
run-paper3.1.0plugins.gradle.org

Step by step

Each step with commands to copy. The list on the left shows where you are.

01

Create the Gradle project

The PaperMC repository and a compileOnly dependency: the server provides the API, so you do not bundle it into the jar. The + in 26.3.build.+ picks the latest 26.3 build. When you need reproducible builds, write a specific number, for example 26.3.build.157-beta.

The run-paper plugin adds a runServer task that downloads Paper in the given version and starts it with your plugin.

build.gradle.kts
plugins { java id("xyz.jpenilla.run-paper") version "3.1.0"}group = "com.example"version = "1.0.0"repositories { maven(url = "https://repo.papermc.io/repository/maven-public/") { name = "papermc" }}dependencies { compileOnly("io.papermc.paper:paper-api:26.3.build.+")}java { toolchain.languageVersion.set(JavaLanguageVersion.of(25))}tasks.runServer { minecraftVersion("26.3")}
02

Name the project

rootProject.name becomes the jar name: build/libs/welcome-1.0.0.jar.

settings.gradle.kts
rootProject.name = "welcome"
03

Describe the plugin in plugin.yml

The required fields are name, version and main, the full name of the class that extends JavaPlugin. api-version says which API version the plugin targets. The welcome.admin permission with default op is held only by server operators.

src/main/resources/plugin.yml
name: Welcomeversion: 1.0.0main: com.example.welcome.WelcomePlugindescription: Greets players with a message from config.ymlapi-version: '26.3'permissions: welcome.admin: description: Reloads the configuration default: op
04

Add the default configuration

saveDefaultConfig writes this file to plugins/Welcome/config.yml on first start. The admin edits the message there, and your code reads it with getConfig.

src/main/resources/config.yml
# MiniMessage: <green>, <bold>, <gradient:#61cafa:#2112fc> and the <player> placeholdermessage: "<green>Welcome to the server, <player>!</green>"
05

Write the main class and the event

In onEnable you register the event listener and the command. Paper's registerCommand registers the command in code, with its description and suggestions, with no commands entry in plugin.yml.

Placeholder.unparsed inserts the player's name as plain text. If you glued the name into the template with string concatenation, a player with MiniMessage tags in their name could change how the message looks.

src/main/java/com/example/welcome/WelcomePlugin.java
package com.example.welcome;import net.kyori.adventure.text.Component;import net.kyori.adventure.text.minimessage.MiniMessage;import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerJoinEvent;import org.bukkit.plugin.java.JavaPlugin;public final class WelcomePlugin extends JavaPlugin implements Listener { @Override public void onEnable() { saveDefaultConfig(); getServer().getPluginManager().registerEvents(this, this); registerCommand("welcome", "Shows or reloads the greeting", new WelcomeCommand(this)); getLogger().info("Welcome ready"); } Component greeting(Player player) { String template = getConfig().getString("message", "<green>Welcome, <player>!"); return MiniMessage.miniMessage().deserialize(template, Placeholder.unparsed("player", player.getName())); } @EventHandler public void onJoin(PlayerJoinEvent event) { event.getPlayer().sendMessage(greeting(event.getPlayer())); }}
06

Write the command

BasicCommand is the simplest way to write a command in Paper: execute receives the source and the arguments, and suggest returns suggestions. getExecutor is whoever the command runs as, including under /execute as, and getSender is whoever typed it.

src/main/java/com/example/welcome/WelcomeCommand.java
package com.example.welcome;import io.papermc.paper.command.brigadier.BasicCommand;import io.papermc.paper.command.brigadier.CommandSourceStack;import java.util.Collection;import java.util.List;import org.bukkit.command.CommandSender;import org.bukkit.entity.Player;public final class WelcomeCommand implements BasicCommand { private final WelcomePlugin plugin; WelcomeCommand(WelcomePlugin plugin) { this.plugin = plugin; } @Override public void execute(CommandSourceStack source, String[] args) { CommandSender sender = source.getSender(); if (args.length == 1 && args[0].equalsIgnoreCase("reload")) { if (!sender.hasPermission("welcome.admin")) { sender.sendRichMessage("<red>Missing permission welcome.admin"); return; } plugin.reloadConfig(); sender.sendRichMessage("<green>Reloaded config.yml"); return; } if (source.getExecutor() instanceof Player player) { player.sendMessage(plugin.greeting(player)); } else { sender.sendRichMessage("<gray>Usage: /welcome or /welcome reload"); } } @Override public Collection<String> suggest(CommandSourceStack source, String[] args) { return args.length <= 1 ? List.of("reload") : List.of(); }}
07

Build the plugin and start a test server

gradle build creates the jar in build/libs. gradle runServer downloads Paper 26.3, starts it in the run directory and loads the plugin. On first start the server stops at the EULA: read it, set eula=true in run/eula.txt and start again.

For a real server you copy just the jar into the plugins directory and restart the server.

gradle
Command
gradle build
Output
build/libs/welcome-1.0.0.jar
Command
gradle runServer
Output
Latest build for 26.3 is 157.[PluginInitializerManager] Bukkit plugins (1): - Welcome (1.0.0)

How to check it works

We built the project from this guide in Gradle 9.8.0 with Java 25. The 26.3.build.+ dependency resolved to 26.3.build.157-beta, and the classes have class file version 69, which is Java 25.

runServer downloaded Paper 26.3 build 157, verified the jar's SHA-256 hash and listed our plugin among the Bukkit plugins. Start-up stopped at the EULA, which we do not accept on your behalf.

Environment
Gradle 9.8.0, Java 25
Result
Plugin built and loaded, the start waits for the EULA

What you should see

  • gradle build ends with build/libs/welcome-1.0.0.jar.
  • After accepting the EULA, the server log has the line "Welcome ready".
  • A joining player sees a green message with their name.
  • /welcome reload works only for an operator.
gradle runServer
Command
gradle runServer
Output
Fetching latest Paper build for version 26.3...Latest build for 26.3 is 157.Verified SHA256 hash of downloaded jar.[bootstrap] Running Java 25 (Eclipse Adoptium Temurin-25.0.4.1+1)[bootstrap] Loading Paper 26.3-157-main@4728a90 for Minecraft 26.3[PluginInitializerManager] Bukkit plugins (1): - Welcome (1.0.0)You need to agree to the EULA in order to run the server.
  1. 2-4
    Paper downloaded and checked

    runServer downloaded Paper 26.3 build 157 and checked the file's SHA-256 hash.

  2. 5-6
    Java 25

    The server runs on Java 25, the one the toolchain in build.gradle.kts sets.

  3. 7-8
    The plugin on the list

    Welcome 1.0.0 is on the list of Bukkit plugins.

  4. 9
    Stopped at the EULA

    The start stopped at the EULA, which we do not accept for you. Put eula=true in run/eula.txt once you have read it.

The Paper plugin at Flaem

How it looks in our project

The Paper plugin of the Flaem platform connects a Minecraft server to the platform: the player list with skins, TPS and MSPT stats, moderation actions and handing over store purchases. It runs on Paper, Purpur and Folia because it uses Paper's schedulers (GlobalRegionScheduler and the entity scheduler), which are the same on all three.

The key rule in this code helps in any plugin: checking the player and running the command happen on the server thread, never on the thread that waited for a network response. The excerpt is the store client: the plugin polls the platform's delivery queue over HTTPS. Hand over a plugin when it has to connect the server to a store, a panel or Discord and run on Paper, Purpur and Folia at once; game plugins start from PLN 299 (about EUR 67).

See the project
A Minecraft server store in the inventory window with the price, the balance and a daily limit
a plugin of the kind we build for Minecraft servers: a store in the inventory window with the price, the balance and a daily limit
StoreClient.java
/** * Polls the platform's own delivery queue directly over outbound HTTPS. * A leased delivery for a player who is not online right now is left * un-acknowledged rather than retried locally: the platform's lease expires * on its own and offers the same delivery again. */private void handleOne(String leaseToken, Map<String, Object> delivery) { String deliveryId = (String) delivery.get("id"); String playerIdentifier = (String) delivery.get("player_identifier"); String command = (String) delivery.get("command"); if (deliveryId == null || playerIdentifier == null || command == null) { return; } Player player = schedulers.onGlobal(() -> resolvePlayer(playerIdentifier)); if (player == null) { // Not online - leave it leased. the platform offers it again once the lease expires. return; } String resolvedCommand = command.replace("{player}", player.getName()); boolean dispatched = schedulers.onGlobal( () -> Bukkit.dispatchCommand(Bukkit.getConsoleSender(), resolvedCommand)); // ...}

Common errors

Symptom, cause and fix, with the number of the step where the error shows up.

StepSymptomCauseFix
01 Could not find io.papermc.paper:paper-api:1.21...-R0.1-SNAPSHOT for 26.x The old version format from tutorials written before 26.1. Use 26.3.build.+ or a specific build number.
01 Unsupported class file major version 69 Compiling or running the server on Java older than 25. Set the toolchain to 25 and run the server on Java 25.
07 You need to agree to the EULA No eula=true in the test server's eula.txt. Read the EULA and set eula=true in run/eula.txt.
03 The plugin does not load, Invalid plugin.yml in the log Missing name, version or main, or main points to a class that does not exist. Check the full class name including the package.
05 A player name changes the message colour The name glued into the MiniMessage template by concatenation. Insert player data with Placeholder.unparsed.

Frequently asked questions

The questions that come up with this setup.

Paper, Spigot or Bukkit?
Write a new plugin for Paper: it has a newer API, for example BasicCommand and bundled MiniMessage, and it runs on Paper and its derivatives such as Purpur. Bukkit and Spigot are the older APIs Paper grew out of, so plugins written for them usually run on Paper as well, but a plugin that uses the Paper API will not run on Spigot.
How much does a custom Minecraft plugin cost?
Game plugins start from PLN 299 (about EUR 67) at VulCode, and an integration with a Minecraft server, a store or Discord affects the scope.
What is paper-plugin.yml?
It is Paper's newer plugin descriptor format. The PaperMC documentation for the IntelliJ project wizard still does not recommend it because it is in development, so this guide uses plugin.yml.
How do I update the plugin for a new Minecraft version?
Change the dependency version and api-version, rebuild and run runServer with the new version. The compiler shows which API methods changed or disappeared.
Can I make HTTP requests in a plugin?
Yes, but never on the server thread, or you freeze the game while waiting. Make them asynchronously and hand the result back to the server thread, as in the item shop guide.
Which Java version does Paper 26.3 require?
Java 25. Gradle picks the JDK through the toolchain, but you need Java on the machine to run Gradle itself.

Sources

The documentation and specifications we compared the commands with.

Other guides

Tools

  • Minecraft color codes and MOTD generatorMinecraft color codes (§ and &) for MOTDs and lore: type text, pick colors and copy the string. Plus the cheapest anvil order for enchantments.
  • server.properties generatorGenerate a Minecraft server.properties file: set game mode, difficulty, MOTD, whitelist and view distance with a server list preview. Free, in your browser.

Glossary terms

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.