Prerequisites: -Maven -Git -Java(JDK) -BuildTools What will we do in this tutorial? We'll modify spigot/craftbukkit to add some code using patches. As example i'll add the method Code (Text): helloWorld() that will send an "hello world" message to the player Introduction: The patch injection system is a powerful system that allows us to easily customize our spigot. It is used mainly to add patches to bukkit/craftbukkit but we can aswell use it for our own purpose. How to: First you need to put your BuildTools.jar in a folder and make it compile with the git bash It will take a while, It's downloading and compiling spigot! In order to do so It must download and decompile craftbuikkit, apply the spigot patches and recompile itself. After the process ended it will leave all the work dirs. The one that we're intrested in is the Spigot dir. We can close the terminal and explore what did the BuildTools left for us. In the directory there are a lot of other dirs and some files. We're instrsted mainly in those dirs: "Bukkit-Patches", "CraftBukkit-Patches", "Spigot-API", "Spigot-Server". The first two dirs contain the patches that were applied to spigot: the first speifies what to apply to the bukkit api, the latter specifies the ones to add to craftbukkit. The other two dirs contain the source code of spigot but the first contains only the Spigot API (bukkit) and the second contains only the stuff not essential for the api (craftbukkit & other) We need to create a patch but, to make the process more simple (no one wants to create a .patch file directly) we will modify the source and let Maven do the dirty work. You can modify the source with every text editor but in this tutorial I'll use Intellij idea. First we need to Open the Maven project: Click next until it asks the name of the project, write "Spigot" or something similar and finish the process. It will give a warning related to maven but we only need to modify the code so it doesn't matter. Here comes the fun part, develop what you want. I made the helloWorld() method: I could make it easier writing a default method in the Player class but that's too easy: Ok, once it's all written save and exit, we don't need no IDE anymore. We need to open the console and add every file we modified with "git add path\to\File.java" Once we're done we need to write "git commit -m <message>" where the message arguments specifies what has the path modified. WARNING: You need to do the git add/commit two times: once for Spigot-API and the other for Spigot-Server Note: the messagges can be different, I take them equal for order. Once this is done we just need to use the "rebuildPatches.sh" and the .patch file will be created. To build the project and obtain the custon spigot.jar we need to write "mvn clean install" The jar created will be in "Spgiot-Server\target", it's the one without original in its name. Here's the jar, now we can import and use it! Remember to replace it with the original one in the server dir!