MC
MCEngine/mcextension-template
A repository template for building extensions.
MCExtension Example
This repository is a minimal example project showing how to build an external extension that implements the io.github.mcengine.mcextension.api.IMCExtension API.
What this is
- An example extension JAR that can be loaded by a host plugin using MCExtension.
- The extension entrypoint is defined in
src/main/resources/extension.yml.
Requirements
- Java 17+
- Gradle (the wrapper is included)
Dependency
This project targets:
<dependency>
<groupId>io.github.mcengine</groupId>
<artifactId>mcextension</artifactId>
<version>2026.0.3-6</version>
</dependency>And the PaperMC API:
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
</dependency>Project structure
src/main/java/.../ExampleExtension.java- Implements
IMCExtension - Provides lifecycle hooks:
onLoad(JavaPlugin plugin, Executor executor)onDisable(JavaPlugin plugin, Executor executor)
- Implements
src/main/resources/extension.yml- Declares the extension
name,version, andmainclass
- Declares the extension
extension.yml configuration
The extension.yml file defines how your extension is loaded:
name: "MyExtension"
main: "io.github.mcengine.MyExtension"
version: "1.0.0"
extension:
depend: [OtherExtID] # optional: other extensions required
git:
provider: github # or gitlab
owner: my-org # repo owner/group
repository: my-repo # repo name
# token omitted: resolved from env (USER_GITHUB_TOKEN / USER_GITLAB_TOKEN) or host plugin config git.tokenConfiguration options
- name: Unique identifier for your extension (required)
- main: Fully qualified class name of your main extension class (required)
- version: Extension version string (required)
- extension.depend: List of extensions that must be loaded before this one (optional)
- git.provider/owner/repository: Git hosting details for publishing (optional; tokens resolved from env/host config)
Build
Run:
.\gradlew.bat clean buildThe JAR will be created under:
build/libs/
Using the extension
- Copy the built JAR into the location your host plugin scans for extensions.
- Ensure the host plugin is installed and started before the extension loads.
- On server start/stop you should see log messages emitted by
ExampleExtension.
On this page
Languages
Groovy80.8%Java18.0%Dockerfile1.1%
Contributors
MIT License
Created January 24, 2026
Updated February 19, 2026