Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Using the plugin API

Sasha edited this page Oct 31, 2018 · 1 revision

So you wanna write a plugin, huh?

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.

Setting up your IDE

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).

IntelliJ Libraries

Next, create your package and your main class.

IntelliJ project files

Now, extend your Main class to RePlugin

fjds

And then implement the methods that it suggests you implement

jflsdjf

Now, you can do as you wish within those functions. If you want to do events, implement SimpleListener and register it.

sdlfjsdl

And, well, from there you can basically do whatever you want.

feds

Compiling

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:

doot

tip: Make sure that any third party libraries that aren't included in RE_Minecraft are extracted into the built jar!