Building from Source
To build PetarLib from source, follow these steps:
- Ensure you have Java 21+ and Git installed.
warning
Minecraft version 26.1-snapshot-1 (PetarLib v2.0.0+) and above require Java 25 and using java 21 wont work
- Clone the repository:
git clone https://github.com/PetarMc1/PetarLib.git
cd PetarLib - Build using Gradle:
./gradlew build
# or
gradlew.bat build - The built jars will be in
build/libs/.
Building All Versions
To build PetarLib for all supported Minecraft versions, use the buildAllVers task:
./gradlew buildAllVers
# or
gradlew.bat buildAllVers
This will build the library for the default version and all versions defined in the props/ directory. The output jars will be in build/libs-versioned/.
Jenkins Builds
If you prefer not to build from source but you want build for the current commit you can download pre-built jars for each commit from the CI server.
- Visit the PetarLib Jenkins page.
- Download the jar files from the latest (or the build you want from) artifacts.
- Use these jars directly in your mods folder, similar to the installation instructions.