Eclipse Setup - LucFr1746/Minecraft-Coding GitHub Wiki
In this tutorial, you can learn how to set up an eclipse project. Scroll down for more details. Good luck!
Download needed things:
- Java (Required to run Minecraft.)
- Eclipse (The program you are going to code on.)
- Java Development Kit (Library needed to write code.)
-
Spigot Library API (Select and download the version of the spigot server you want to open.)
- Paper MC (For a better performance Minecraft server. Recommended.)
On the first launch, it will ask you to Select a directory as workspace. Then you can choose where the workspace will save to.
After you choose where the workspace will save, an Eclipse window will pop in.
Then Create a java project ➜ Name your project ➜ Click finish.
Next step, you need to add Build Path to the project you just created.
Right-click on your project ➜ Build Path ➜ Add External Archives ➜ Choose the Spigot API you downloaded in the first step.
Create a package and main class.
Click on your project ➜ New Java Package icon ➜ Name your package with this simple rule "me.Your-Name.Your-Project-Name".
Package names are written in all lowercase to avoid conflict with the names of classes or interfaces. More info.
Click on your package you just created ➜ New Java Class icon next to New Java Class icon ➜ Name your class to "Main" or "Project-Name" for easy seeing.
Add Java Plugin extends
Following this and make sure you are importing the class by moving the cursor to the error text, waiting for the quick fixes to pop in, and choosing Import the class. It might name "org.bukkit.plugin.java.JavaPlugin".
And now you are basically done with the first setup of your eclipse to code a plugin on.