Requirements
Prerequisites
Install Java 21
Download and install Java 21 Eclipse Adoptium from adoptium.netVerify installation:You should see output indicating Java 21.
Build Tasks
BetterHud provides several Gradle tasks for building different platform variants and artifacts.Build All Platforms
Build all available platform jars (Bukkit, Velocity, Fabric) plus source and javadoc jars:This is the most common build command. It produces all platform jars and documentation.
build/libs/):
BetterHud-bukkit-VERSION.jar- Bukkit/Spigot/Paper/Folia pluginBetterHud-velocity-VERSION.jar- Velocity proxy pluginBetterHud-fabric-VERSION.jar- Fabric server-side modBetterHud-VERSION-sources.jar- Source code jarBetterHud-VERSION-javadoc.jar- API documentation
Platform-Specific Builds
Build only the platform you need:- Bukkit
- Velocity
- Fabric
Build only the Bukkit plugin:Output:
bootstrap/bukkit/build/libs/BetterHud-bukkit-VERSION.jarThis jar works on Bukkit, Spigot, Paper, and Folia servers running Minecraft 1.20.4 to 1.21.11.
Documentation & Sources
Build Source Code Jar
Generate a jar containing all source files:build/libs/BetterHud-VERSION-sources.jar
Source jars are useful for IDE integration and debugging when developing plugins that use BetterHud’s API.
Build Javadoc Documentation
Generate API documentation using Dokka:build/libs/BetterHud-VERSION-javadoc.jar
Extract and view the documentation:
BetterHud uses Dokka to generate Kotlin-friendly documentation with enhanced formatting.
Generate Dokka HTML Documentation
Generate browsable HTML documentation without packaging:build/dokka/html/
Open build/dokka/html/index.html in your browser to view the documentation.
Development Tasks
Running a Test Server
BetterHud includes a task to run a Paper test server with the plugin automatically loaded:This will:
- Download Paper server for the configured Minecraft version
- Set up a test server environment
- Install BetterHud and dependency plugins (ViaVersion, ViaBackwards, PlaceholderAPI, Skript)
- Start the server
run/ directory. Use stop in the server console to shut it down.
Clean Build Artifacts
Remove all build outputs and start fresh:Build Configuration
Understanding the Build Structure
BetterHud uses a multi-module Gradle project structure:Key Build Files
build.gradle.kts
The root build file defines:- Multi-platform build tasks
- Source and javadoc jar generation
- Publishing configuration for Modrinth and Hangar
- Test server setup
build- Build all platformspluginJar- Build Bukkit onlyfabricJar- Build Fabric onlyvelocityJar- Build Velocity onlysourcesJar- Package source codejavadocJar- Generate and package API docsrunServer- Run test Paper servermodrinthPublish- Publish to Modrinth (requires API token)
Gradle Properties
The build reads version and configuration fromgradle.properties and version catalogs.
Key properties:
minecraft_version- Target Minecraft versionversion- BetterHud version
Publishing (Maintainers Only)
Publish to Modrinth
Publish all platform builds to Modrinth:Publish to Hangar
Publish to PaperMC’s Hangar:COMMIT_MESSAGE environment variable.
Troubleshooting Build Issues
Build Fails with Java Version Error
Solution: Ensure you’re using Java 21:JAVA_HOME:
Gradle Daemon Issues
If builds are failing mysteriously, try stopping the Gradle daemon:Dependency Download Failures
If dependencies fail to download:- Check your internet connection
- Try clearing Gradle cache:
Out of Memory Errors
If the build runs out of memory, increase Gradle’s heap size: Create/editgradle.properties in the project root:
Next Steps
After building BetterHud:Install the Plugin
Learn how to install your freshly built plugin on a server
Contributing Guide
Want to contribute? Read our contribution guidelines
API Development
Build plugins that integrate with BetterHud
Report Issues
Found a build problem? Report it on GitHub
