If you do use Java 1.8 or 11 features, Eclipse will suggest changing the language level when you hover over the code "error". Please note that according to BStats, a sizeable number of servers run Java 8 (~64% as of April 2021), so compiling for Java 11 will result in many server owners being unable to run your plugin. You may use other levels, such as 1.8 for Java 8 or 11 for Java 11. Copy and paste this (specifies that the project should be built under Java 7) before : If you wish to use Java 6+ language features, you must specify the Java version that the project should be built on. Click the pom.xml tab at the bottom, and you should see something like this: Now, you should have a window that looks like this:Ĭlick the arrow to the left of your artifact name, and let's get started!īefore you begin developing your plugin you will need to add the Bukkit API library to your project as a dependency, you can also add any other API's you may want to use.ĭouble-click pom.xml, which is at the bottom of your project's folder. If this is your first time using Eclipse, close the Welcome tab by clicking the "X" next to the Welcome tab on the tab bar. For the version, simply stick with the default for now.
If you are creating a plugin called TestPlugin your full group name would be io.github., and your artifact name would be TestPlugin. Lets use the GitHub Pages example for this. Once you have the base group name, you will want to finish it off with the plugin name. There are several things that your group must not begin with and those are: Simply use any unique group naming, again, use this as your last resort. This is used by many plugin developers.For GitHub, follow the instructions here and you will have a sub-domain, so your package would be io.github.Create an account on a source control site such as GitHub or sourceforge.No domain? Here are some common conventions.Ex: your package would be com.i_am_a_bukkit_developer source.If you have a domain name, the package would be the domain name in reverse.Now, you need to name your group as follows:
If you can't see Maven folder, then you need to go download the m2eclipse plugin from Click next, and then tick the Create a simple project box on the next page, and then click Next:
Now, open up the Maven folder, and select Maven Project. Start Eclipse, then create a new Project by selecting File -> New -> Project: Starting a Plugin Project Create a Projectīefore starting you'll need to set up your workspace and files in Eclipse. The version for Java EE developers does not ship Maven support, which is required for this tutorial.Īlternatively, you can use IntelliJ IDEA and follow this tutorial if you prefer JetBrains' IDE instead of Eclipse. You MUST download the Eclipse build for Java developers, NOT the one for Java EE developers. The following tutorial contains instructions for the Eclipse IDE.įor further information, see Setting Up Your Workspace This includes but is not limited to installing an IDE (Integrated Development Environment). MOOC.fi - A big course, designed to take about 12 weeksīefore developing a plugin (or learning Java) you will need to set up a development environment.Derek Banas - Faster paced Video tutorials.TheNewBoston - TheNewBoston's video tutorials.
Oracle's Java Tutorials - Official tutorialsĬodecademy's Free Interactive Courses - Interactive Courses If you are just getting started with Java or need a refresher, the following is a non-exhaustive list. These tutorials require basic knowledge of the Java programming language. It starts with making sure you understand Java, sets up your workspace in an IDE, and introduces the essentials of most Bukkit plugins. It is in no way a complete tutorial of all possibilities in Bukkit, but rather a general overview of the basics. This rather large tutorial aims at getting you started with plugin development in Bukkit.
19.5 Spawn Lightning Bolt Where Player is Looking.19.4 Hiding a Player From Another Player.11 Scheduling Tasks and Background Tasks.8.5.3 Check if a Player is online before getting them.8.5.1 Make sure the sender is a Player before casting.8.4 Using a separate CommandExecutor class.8.2 Adding your Command to the Plugin.yml.6.1 Introduction to onEnable() and onDisable().