Build Your First Plugin

Learn to create a complete RuneLite plugin from scratch. This step-by-step tutorial will guide you through project setup, writing code, and testing your plugin.

8 steps
Progress1 / 8 steps
1

Project Setup and File Structure

Step 1 of 8

Objective

Set up your development environment and create the basic project structure for a RuneLite plugin.

Explanation

Before you can start coding, you need to set up your development environment. RuneLite plugins are Java projects that use Gradle as the build system. You'll need: - Java Development Kit (JDK) 11 ) - An IDE like IntelliJ IDEA - Gradle (usually comes with the IDE) -Example-pligin https://github.com/runelite/example-plugin The basic file structure for a RuneLite plugin looks like this: ``` example-plugin/ ├── build.gradle <-- We will update this ├── runelite-plugin.properties <-- Core plugin info ├── src/ │ ├── main/ │ │ ├── java/com/example/ │ │ │ ├── ExamplePlugin.java │ │ │ └── ExampleConfig.java │ │ │ └── test/ │ └── java/com/example/ │ │ └── ExamplePluginTest.java <-- This is the main class for the 'run' task │ └──resources/ │ │ └── logback.xml ``` The build.gradle file defines your project dependencies and build configuration. This modern setup includes: - Proper repository ordering (mavenLocal last to avoid broken cached files) - Automatic OS detection for LWJGL natives (supports Apple Silicon/M-series Macs) - Testing dependencies - adding into src/main/resources we need to add logback - Custom tasks for running and building your plugin

Your Code

java
AdvertisementSet slotId on <AdUnit /> to show ads.