Here's some instructions how to setup a new Mod project for Minecraft Java using Eclipse. It's really so I can remember how to do this in future!
First, I built spigot. The instructions are here: https://www.spigotmc.org/wiki/buildtools/ (I built spigot_1.16.5.jar Windows)
There's a whole world of exploring to do around setting up Minecraft servers, let alone playing the game and I can't do it justice here. Needless to say, I'm making the assumption you already know how to run a Minecraft server locally.
Now, to create the project follow these steps:
- Open Eclipse
- Select File -> New -> Java Project
- In the Dialog, enter the name of the project, MinecraftMod, say, and click Next
- Select the Libraries tab on the next Dialog then select Add External JARS... Add the spigot jar built earlier
- Click on Finish
- Select File -> New -> Class
- In the Dialog, enter com.javaminecraft into the Package field, the Name of the Mod into the Name field and make sure the main method stub is unchecked
- Click Finish
- Enter the Java code for the Mod (I won't tell you what to write here!)
- We now need to create the plugin.yml. Select File -> New -> File
- Call the file plugin.yml
- Make sure the Parent Folder is the name of the project, MinecraftMod in this case
- Enter the yaml required for the Mod (again, not for this blog)
- To be able to add to the Minecraft server we need to export as a JAR. Right-click on the Project name and click on Export...
- Select Java -> JAR File
- The export destination will be the Minecraft plugins folder for the server
- Restart the Minecraft server
There. Hopefully this is a simple recipe for setting up from scratch.
No comments:
Post a Comment