Skip to main content
The client provides full Java runtime support and runs standard Java bytecode. By default, the client uses Java 21. You can compile with Java 21, but if you want to ensure compatibility with older launchers, you may also compile with Java 8.

Development Tools

We recommend using IntelliJ IDEA or Eclipse for development:

Set up SDK and Workspace

We recommend using Zulu 21 as your SDK.
If you want to develop Java 8 extensions, use any JDK 8 distribution.
Once Java is ready, clone or download the example extension and import it into your IDE.
If you have Git installed, you can clone with:
git clone https://github.com/opai-client/example-extension.git
Maven should automatically configure the project. After configuration, you can start editing code.

Packaging

Before you begin editing, change the package name of the example extension and update the name field in the @ExtensionInfo annotation inside ExampleExtension.java.Many users install this example extension for testing purposes — modifying these values avoids conflicts.
After editing, you can build the JAR using the Maven sidebar in IntelliJ IDEA and selecting the package command. package Once built, the JAR will be generated in the target directory. Copy this JAR file into the %appdata%\Opai\extensions folder to load it in the client.

Debugging

In the client, you can reload extensions using:
.extension reload
This reloads all extensions. After editing code, repackage and use this command to test quickly. For debugging without repackaging, look into JDWP (Java Debug Wire Protocol) and use your IDE’s debugger.

Developer Documentation

The developer documentation is provided in Javadoc format. Inside the IDE, you can Ctrl + Right Click any API class name, then click Download Source to view the Javadoc (only needs to be done once). doc doc Almost every method has detailed comments — simply read the annotations to understand what a method does.