Premium Resource Placeholders & Identifiers.MySQL database integration with your plugin.
Creating an update checker that checks for updates.Creating a plugin with Maven using IntelliJ IDEA.
Creating a blank Spigot plugin in VS Code.Creating a blank Spigot plugin in NetBeans.Creating a blank Spigot plugin in IntelliJ IDEA.Creating a blank Spigot plugin in Eclipse.Build you Spigot plugin with Gradle Groovy.You can also use build tools like Maven or Gradle or Ant but artifact compilation was used in this tutorial as it is the easiest way to compile your first plugin. Running the Plugin ( top)Copy the plugin from the artifact Output directory to your server plugins folder and start your server. from the top menu and selecting your artifact. Click OK and build it by clicking Build > Build Artifacts. Now you need to include your plugin.yml file to the artifact output by clicking the + > File and locating your file (make sure you do this for your future files such as config.yml too or they simply wont compile in your plugin and appear as missing). Select your Artifact and set the Output directory to where you want to build your plugin jar. In the first box make sure to select the Module you want to export. Choose JAR > From modules with dependancies. Name : Plugin Name # the plugins name as it should appear in the plugin list /plĪpi-version : # the version of the API you want to use, required starting with 1.13įor more details check out the plugin.yml wiki.Ĭompiling and Building Your Artifact ( top)Ĭompiling and building is simple, but first we need to create the artifact.īring up the Project Structure menu like before and this time select Artifacts on the left navigation bar.Ĭlick on the + at the top. Your code should now look similar to this: Import the class manually by pressing Alt + Enter and choose import class. Otherwise you will see the word JavaPlugin in red because you havent imported the class location from the Spigot API. You can choose a suggestion by using the arrow keys and Enter but you can also use the mouse. You will see IntelliJ giving you some suggestions as you type. This is the concept of inheritance ( homework). This makes your class inherit all fields and methods in the Spigot JavaPlugin class. Your Main class should extend JavaPlugin. It's common to name it with your plugin name or just Main. Now right-click on the package you just created and choose New > Java Class. *note: the ide cant tell you if your package already exists for another plugin, you have to make sure by yourself.If both are taken, try your email, e.g.If you own a website or a domain, set the package name to.To avoid conflicts with other plugins with the same Main class directory, the general guideline is:.You can name your package following these guidelines: In the project explorer on left, locate your module and right-click on the source folder - src, and select New > Package. The packages act like folders for your plugin. Click on the + button and select JARs and directories., locate your SpigotAPI jar and click Apply. Open the Project Structure from File > Project Structure.įrom here select Modules on the left side and click on Dependencies below Name. Now you have to add the Spigot library to IntelliJ. If you previously wrote your plugins in Eclipse you can change from the modules view to the package view. The IntelliJ workspace will pop up and you see on the left side the Project explorer where Modules will be stored at. Once you have filled this in you can click Finish. In this window, you can set the project name and location where the source code and other project files will be stored at. Assuming this is your first plugin on IntelliJ, just click next there.
You will be presented with the option to create the project from a template. On left select Java, and on the right side for your Project SDK select the respective Java version for your plugin. When you start up IntelliJ for the first time you will be presented with the welcome screen. JDK (depending on the minecraft version for your plugin).