In this new Minecraft plugin development guide, I'll show you how to make Minecraft plugins for Bukkit, Spigot and Paper.
This guide covers Minecraft plugins for 1.8.8 to 1.21.
We'll be using IntelliJ with a dedicated extension for Minecraft plugin development to make this process fast and easy.
Do you want a complete step-by-step tutorial on developing your own Minecraft plugins? Click here for a full Minecraft plugin development training.
Bukkit, Spigot and Paper are modifications to the original Minecraft server software made by Mojang, which add support for plugins, configuration options and performance enhancements.
A Minecraft plugin is an extension for Bukkit, Spigot and Paper server used to create events, commands, tools, minigames, monsters etc.
This is different than Minecraft Mods which add new features to Minecraft itself, requiring each player to download the same mod.
Download and install IntelliJ IDEA Community Edition. IntelliJ is the software I'll be using to make Minecraft plugins. It's used by official Google Developers to write Android apps, you can't go wrong with it.
To install Minecraft Plugin Development, open IntelliJ, go to File > Settings > Plugins, type "Minecraft" in the Marketplace tab and install the plugin.
Now, click New Project and configure it using the following options:
- Name: Your plugin's name.
- Location: Where your plugin's code will be stored locally.
- Platform Type: Select Plugin.
- Platform: Select Bukkit.
- Bukkit Platform: Select Paper.
- Minecraft Version: Select your version. If you want to code for 1.8.8 or anything else, leave at latest and see the step below.
- Plugin Name: Should be equal to Name.
- Main Class: Where the main part of the code is located. The path is a reverse domain name which can either be your website (com.matejpacan), your email (com.gmail.matejpacan) or just "me.matejpacan", followed by the plugin name (here custommob), and then the class (here CustomMob), such as org.mineacademy.custommob.CustomMob.
- Build System: Choose Maven.
- JDK: Select Java 21 for Minecraft 1.20.5, 1.21 and greater, select Java 17 for Minecraft 1.17-1.20.4, or Java 8 for anything older than that. Install the appropriate version from this link.
Click Create New. A new project should generate.
The new project should contain the following structure:
- src/main/java folder (this is where your code is) with your main package derived from the main plugin's class path we created above, and your main plugin's class.
- src/main/resource folder (this is where config files are) with plugin.yml, which is a file that the server uses to locate your main plugin's class and plugin information
- pom.xml file used to convert all code and files into a single .jar file you can place into your plugins/ folder as a fully functional plugin
Paper no longer stores old Minecraft versions at their repository so we have to switch to Spigot.
Visit Spigot Maven Repository.
Replace <repository> and <dependency> with paper to Spigot from the page above.
For Minecraft 1.8.8, it should look like so:
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
(...)
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
I have placed the following test line into the onEnable()
method in the main plugin's class:
getLogger().info("Hello MineAcademy.org!");
Then I run the package goal to compile the plugin.
It should open a console window and say Build Success. You can ignore the warnings:
The finished plugin will be in the target/ folder inside your plugin's source folder:
Obtain a copy of your Paper version from papermc.io.
Then create a running script, depending on your operating system:
Create a run.bat
script.
java -Xms4G -Xmx4G -jar paperclip.jar nogui
pause
Create a run.sh
script.
#!/bin/bash
cd "$(dirname "$0")"
exec java -Xms4G -Xmx4G -jar paperclip.jar nogui
Create a run.sh
script.
#/bin/sh
java -Xms4G -Xmx4G -jar paperclip.jar nogui
Place both paperclip.jar and the script in the same folder, let it run, accept the eula.txt and run again and type "stop" to stop it properly.
Finally, drag your plugin .jar from target/ into plugins/ folder, start again and voila, you have your first Minecraft plugin!
I can see my message flashed in the console when the plugin got enabled:
Just run your Minecraft client, open Multiplayer, choose Direct Connection
, type localhost
for your server address.
Once you joined your server, you can type /plugins
and you should see yours listed in green. Mine is listed as "CustomMob".
There is only so much I covered today.
If you want to learn to build minigames, custom mobs, enchants, anti-cheats, GUIs, display entities etc., I prepared a full-featured Minecraft plugin training.
Best, I'm on there 2x/week doing live coaching to answer any questions - you can even unmute yourself and share screen to get your code reviewed, live.
I've been making Minecraft plugins and Java applications since 2011 and I taught people who had zero coding experience as well as professionals running profitable networks. Click here to learn more and I'll see you inside!
nice