Getting Started - GlucoseDev/Glucose GitHub Wiki
Prerequisites:
- Basic Java Knowledge
- An IDE to work in
Step 1: Add Glucose API as dependency
Gradle
- Add the repository
repositories {
maven {
url = "https://repo.zenoc.net/repository"
}
- Add the dependency
dependencies {
implementation 'ml.glucosedev:GlucoseLib:1.0.6-BETA'
}
Step 2: Your main class
There's a serverStartEvent() which is called when the server starts. You can put statements in here to do when the server starts. Consider the following example
public void serverStartEvent() {
System.out.println("Green eggs and ham");
}
Step 3: glucose.inf
glucose.inf tells the server what your plugin is called, its ID, main class, and all sorts of other jazz. Example:
main-class: com.verycool.my.amazing.plugin.Main
name: My amazing plugin
id: myamazingplugin
Step 4: Build
build your plugin, put it into the plugins
directory on your server. You should see something like this before the world loads.
[17:28:13] [Glucose/PluginLoader] [Server thread/INFO]: Loading plugins...
[17:28:13] [Glucose/PluginLoader] [Server thread/INFO]: Loading plugin: TestPlugin1-1.0-SNAPSHOT.jar
[17:28:13] [net.minecraft.server.LoggedPrintStream] [Server thread/INFO]: [STDOUT]: Green eggs and ham