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.
Intellij tutorial code#
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.