Overview
Hangar is PaperMC’s official plugin repository, designed specifically for Paper, Velocity, and Waterfall plugins. MCReleaser provides seamless integration with Hangar’s API, allowing you to publish plugin versions with full metadata including platform dependencies, game versions, and plugin dependencies. The platform automatically normalizes Minecraft versions and handles authentication through Hangar’s API key system.Required Credentials
To publish to Hangar, you need:- Hangar API Key: An API key from your Hangar account settings
- Project Slug: Your project’s identifier (found in your project URL)
Configuration Options
The Hangar API key for authentication.
The project slug or identifier. You can find this in your project’s URL:
https://hangar.papermc.io/[owner]/[project]Use the full path: owner/projectExample: HSGamer/BetterEconomyThe release channel for this version. Hangar uses channels to organize different types of releases.Common channels:
Release, Beta, AlphaYou must create the channel in Hangar before using it.The platform that your plugin targets.Valid platforms:
PAPER, WATERFALL, VELOCITYThe platform name is case-insensitive in the configuration, but must be one of the valid Hangar platforms.
Space-separated list of Minecraft versions that your plugin supports.MCReleaser will automatically normalize and validate versions.Examples:If not set, falls back to the common
GAME_VERSIONS variable.JSON array of plugin dependencies. Each dependency specifies a Hangar project and whether it’s required.The JSON structure should match Hangar’s Example:
PluginDependency format:Implementation Details
The Hangar platform implementation performs the following steps:- Authentication: Exchanges the API key for a session token
- Version Normalization: Fetches and normalizes Minecraft versions
- Metadata Preparation: Constructs the version upload payload including:
- Version number and description
- Platform and game version dependencies
- Plugin dependencies
- Release channel
- Upload: Uploads the primary file with metadata to Hangar
Complete Example
Advanced: With Dependencies
Here’s an example with plugin dependencies:Docker
Supported Platforms
Hangar supports three platform types:- PAPER: For Paper/Spigot/Bukkit plugins
- VELOCITY: For Velocity proxy plugins
- WATERFALL: For Waterfall/BungeeCord plugins
Source Code Reference
The Hangar platform implementation can be found in:- Platform logic:
hangar/src/main/java/me/hsgamer/mcreleaser/hangar/HangarPlatform.java - Configuration keys:
hangar/src/main/java/me/hsgamer/mcreleaser/hangar/HangarPropertyKey.java - Data models:
hangar/src/main/java/me/hsgamer/mcreleaser/hangar/model/VersionUpload.java