Skip to content

Commit 43ccbd7

Browse files
committed
add readme
1 parent 44f9007 commit 43ccbd7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ZenithProxy Example Plugin
2+
3+
[ZenithProxy](https://github.com/rfresh2/ZenithProxy) is a Minecraft proxy and bot.
4+
5+
This repository is an example core plugin for ZenithProxy, allowing you to add custom modules and commands.
6+
7+
## Installing Plugins
8+
9+
Plugins are only supported on the `java` ZenithProxy release channel (i.e. not `linux`).
10+
11+
Place plugin jars in the `plugins` folder inside the same folder as the ZenithProxy launcher.
12+
13+
Restart ZenithProxy to load plugins, loading after launch or hot reloading is not supported.
14+
15+
## Creating Plugins
16+
17+
Use this repository as a template to create your own plugin repository.
18+
19+
### Plugin Structure
20+
21+
Each plugin needs a main class that implements `ZenithProxyPlugin` and is annotated with `@Plugin`.
22+
23+
Plugin metadata like its unique id, version, and supported MC versions is defined in the `@Plugin` annotation.
24+
25+
[See example](https://github.com/rfresh2/ZenithProxyExamplePlugin/blob/1.21.0/src/main/java/org/example/ExamplePlugin.java)
26+
27+
### Plugin API
28+
29+
The `ZenithProxyPlugin` interface requires you to implement an `onLoad` method.
30+
31+
This method provides a `PluginAPI` object that you can use to register modules, commands, and config files.
32+
33+
`Module` and `Command` classes are implemented the same as in the ZenithProxy source code.
34+
35+
I recommend looking at existing modules and commands for examples.
36+
37+
* [Module](https://github.com/rfresh2/ZenithProxy/tree/1.21.0/src/main/java/com/zenith/module)
38+
* [Command](https://github.com/rfresh2/ZenithProxy/tree/1.21.0/src/main/java/com/zenith/command)
39+
40+
### Building Plugins
41+
42+
Execute the Gradle `build` task: `./gradlew build` - or double-click the task in Intellij
43+
44+
### Testing Plugins
45+
46+
Execute the `run` task: `./gradlew run` - or double-click the task in Intellij
47+
48+
This will run ZenithProxy with your plugin loaded in the `run` directory.
49+

0 commit comments

Comments
 (0)