Using the plugin API
Awesome, we're all excited to see what you write for RE:Minecraft, but first I should teach you how to actually use the API.
The API is similar to how the Bukkit API works, you extend
your main class to RePlugin
, and implement SimpleListener
if you want to listen for events, and when you're ready to release it, you make a plugin.yml
file.
First, download an RE_Minecraft.jar
from the project's releases, preferably the latest version, and create a new project in IntelliJ.
Add the RE_Minecraft.jar
to your project as a library (through intellij itself or a dependency manager, like gradle, whichever you prefer).
Next, create your package and your main class.
Now, extend
your Main class to RePlugin
And then implement the methods that it suggests you implement
Now, you can do as you wish within those functions. If you want to do events, implement SimpleListener
and register it.
And, well, from there you can basically do whatever you want.
To compile, you need to include any additional libraries you used in your project, and include a plugin.yml
file.
name: "MySpecialPlugin"
description: "A special plugin <3333"
authors:
- "Hausemaster"
version: "1.0" # version of ur plugin
mainClass: "com.example.reminecraft.Main" # CaSe SeNsItIvE
Please note that all of these fields are REQUIRED!
After that, compile your plugin as usual, your Artifact window should look smth like this:
tip: Make sure that any third party libraries that aren't included in RE_Minecraft are extracted into the built jar!