Step-by-step guide

How to Create a Minecraft Plugin: Java by Hand or With AI

A Minecraft plugin is a Java .jar that a Paper, Spigot or Bukkit server loads at startup. This guide covers both ways to make one: setting up a Java project yourself, or describing the plugin to an AI that writes, compiles and fixes the code for you.

Free to start · No credit card

Creating a Minecraft plugin with the Spaleforce AI generator

Two routes, one result

Both paths end the same way: a compiled .jar you drop into your server's plugins folder.

Minecraft 1.16 to 26.3

Spaleforce targets Paper, Purpur, Pufferfish, Leaf, Folia, Spigot and Bukkit on Minecraft Java 1.16 through 26.3.

Build errors fixed automatically

If the Maven build fails, the compiler output goes back to our AI, which corrects the code and compiles again.

No card to start

Sign in with Google and use the free plan: 5 generations or modifications per day.

What you need to make a Minecraft plugin in Java

Writing a plugin by hand starts with a small Java project. You need a JDK (Java Development Kit) that matches your server: Minecraft 1.20.5 and later require Java 21 or newer, while earlier releases run on earlier Java versions. You also need a build tool, usually Maven or Gradle, and an editor such as IntelliJ IDEA or VS Code.

In the build file, declare the server API as a provided (Maven) or compileOnly (Gradle) dependency: paper-api from the PaperMC repository, or spigot-api from the Spigot repository. Choose the API version of the server you will actually run. A plugin compiled against a newer API can call methods that do not exist on an older server.

  • A JDK that meets your server's Java requirement
  • Maven or Gradle to build the .jar
  • The paper-api or spigot-api dependency for your target version
  • A local Paper or Spigot server to try the result

Inside a plugin: plugin.yml and the main class

Every plugin needs a plugin.yml at the root of the .jar. It gives the server the plugin's name, version and main class, and usually the api-version, the commands it registers and the permissions it defines. Without a valid plugin.yml, the server refuses to load the file.

The main class extends JavaPlugin. The server calls onEnable() at startup, where you register listeners and command executors, and onDisable() at shutdown, where you save data. Commands declared in plugin.yml are handled by a CommandExecutor; reactions to gameplay, such as a player joining or breaking a block, live in classes that implement Listener.

Values that server owners should be able to change, like messages, cooldowns or prices, belong in a config.yml bundled inside the plugin and read with getConfig(). When the code is ready, mvn package (or the Gradle build task) writes the .jar to the target or build/libs folder.

Creating a Minecraft plugin with AI on Spaleforce

The AI route skips the project setup. You describe the plugin in plain language, pick the server software and the Minecraft version, and our AI writes the Java code: plugin.yml, main class, commands, listeners and config.yml. The project is then compiled with Maven on our servers.

The AI knows which version you picked: it does not use API methods newer than that version and compiles with the matching Java level. Common dependencies such as Vault, PlaceholderAPI, WorldEdit and PlotSquared are resolved automatically during the build.

Once the build succeeds, you download the .jar. You can also open the project in the online editor, read every file, request changes in plain language and go back through the version history.

Installing the plugin .jar on your server

Installation is identical whichever route you took. Stop the server, copy the .jar into the plugins folder next to the server jar, and start the server again. A full restart is safer than reloading plugins on a running server.

Watch the console during startup: a line saying your plugin is enabling means it loaded. In game, /plugins lists every plugin, green when enabled and red when disabled. If your plugin hooks into Vault, PlaceholderAPI or WorldEdit, those plugins must be installed on the server as well, and Vault also needs an economy plugin behind it.

Common Minecraft plugin errors and their fixes

Most broken plugins fall into a few cases, and the console message tells you which one.

On Spaleforce, the first two cases below are handled at build time, since the version you pick sets both the API limit and the Java target, and third-party libraries are resolved during compilation. The dependency plugins themselves still have to be installed on your server.

  • Wrong API version: the console reports an unsupported api-version, or a NoSuchMethodError appears while playing. The plugin was built for a newer Minecraft than the server runs; rebuild it for the server's version.
  • Java too old: an UnsupportedClassVersionError means the .jar was compiled for a newer Java than the one running the server. Update the server's Java or compile for a lower target.
  • Missing dependency: the server says the plugin cannot load because a required plugin is absent. Install it (Vault, PlaceholderAPI...) or declare it as a soft dependency.
  • Invalid plugin.yml: a wrong main class path or broken YAML indentation stops the load before any code runs.

How it works

  1. 1

    Sign in and open the generator

    Sign in with Google, open the plugin generator and choose your server software and Minecraft version.

  2. 2

    Describe the plugin

    List the commands, permissions, messages and settings you want. A precise description gives a first version closer to your needs.

  3. 3

    Let it compile

    Our AI writes the code and Maven builds it. If the build fails, the errors go back to the AI, which fixes them and compiles again.

  4. 4

    Test, adjust, download

    Try the plugin on a test server launched from the editor, ask for changes in plain language, then download the .jar.

Starter prompts for your first plugin

First-join kit
Paper 1.21.4 plugin. When a player joins for the first time, give them a stone sword, 16 bread and a leather chestplate, and broadcast 'Welcome {player} to the server!'. Make the items and the message editable in config.yml.
Homes with a VIP limit
Spigot 1.20 plugin with /sethome <name>, /home <name> and /delhome <name>. Players can save 3 homes, or 10 with the permission homes.vip. Store homes in a YAML file and add a 5-second teleport delay that cancels if the player moves.
Daily reward
Paper 1.21 plugin with a /daily command that gives 250 coins through Vault once every 24 hours per player. If used too early, show the time remaining. Amount and messages in config.yml.
Spawn command
Spigot 1.20 plugin: /setspawn (permission spawn.set) saves the spawn point and /spawn teleports the player there after 3 seconds.

Frequently asked questions

Do I need to know Java to create a Minecraft plugin?

Not with Spaleforce: you describe the plugin in plain language and our AI writes and compiles the Java code. Writing a plugin by hand does require Java and some familiarity with the Bukkit or Paper API.

Is it free to create a Minecraft plugin on Spaleforce?

Yes, you can start free with Google sign-in and no card. The free plan includes 5 generations or modifications per day, with a 2-hour wait between generations. Pro (€20/month) raises this to 20 per day without the wait.

Which Minecraft versions and server types are supported?

The generator covers Minecraft Java 1.16 to 26.3, including 1.21 through 1.21.11 and 26.1.1, 26.1.2, 26.2 and 26.3. Plugins target Paper, Purpur, Pufferfish, Leaf, Folia, Spigot and Bukkit.

Where do I put the plugin .jar?

In your server's plugins folder, next to the server jar. Stop the server, copy the file, start it again, then check the console or run /plugins to confirm it loaded.

Why does my plugin say 'Unsupported API version'?

The plugin declares a newer api-version than your server supports. Rebuild it for the version your server actually runs; on Spaleforce, select that version in the generator before generating.

Can I sell or reuse the plugins I create?

On Pro and Ultimate, plugins carry no Spaleforce mention and commercial use is allowed, royalty-free. On the free plan, the embedded 'Powered by Spaleforce' mention must stay in place.

Create your first Minecraft plugin today

Describe what your server needs, pick the version and get a compiled .jar you can test before it goes live. Free to start, no card required.

Create my plugin

Updated September 17, 2026