This project is a template for creating multi-platform Minecraft plugins/mods that support Bukkit, Fabric, Velocity or any other Minecraft server software you could think of.
- JDK 8 or higher
- Gradle
- Fork and Clone the Repository:
- Fork this repository to create your own copy.
- Clone your forked repository to your local machine:
git clone https://github.com/yourusername/gradle-multiplatformjar-boilerplate.git cd gradle-multiplatformjar-boilerplate
- Rename Project and Packages:
- Update the project name in
settings.gradle
:rootProject.name = 'MyMultiPlatformMinecraftPlugin'
- Change the root project name in
build.gradle
:archivesBaseName = 'MyMultiPlatformMinecraftPlugin'
- Rename the packages in the
common
,bukkit
, andfabric
modules to reflect your new plugin name.
- Update the project name in
- Update Metadata:
- Modify
gradle.properties
with new plugin details. - Update any plugin descriptors:
bukkit/src/main/resources/plugin.yml
fabric/src/main/resources/fabric.mod.json
- Modify
- Change Repository URL:
- Remove the existing Git remote:
git remote remove origin
- Add your own repository as the new remote:
git remote add origin https://github.com/yourusername/your-new-plugin-repo.git
- Remove the existing Git remote:
- Commit and Push Changes:
- Commit your changes:
git commit -am "Renamed project and updated details"
- Push to your new repository:
git push origin master
- Commit your changes:
common/
- Common code shared between platforms.bukkit/
- Bukkit-specific implementation.fabric/
- Fabric-specific implementation.- ...
This command will build a jar file containing the common as well as all implementation-specific classes, configuration files, and libraries configured to be shaded in. If done correctly, this jar will execute on all supported server software.
gradle clean build