PaperMC Documentation
website·Indexed 38 days ago
https://docs.papermc.ioDocumentation for projects under the PaperMC umbrella, including Paper, Velocity, and Folia. It covers the Adventure API for Minecraft chat styling (including MiniMessage), Folia's region logic and administration, Paper server administration, development guides, and tools like the Hangar Downloads Service REST API.
What's inside PaperMC
- Paper's command system is built on Minecraft's Brigadier system, replacing the legacy Bukkit command system. It provides several advantages for developers, including reduced manual parsing and error checking for arguments, improved client-side error checking for users, integration with reload events (supporting datapack commands), and simplified creation of subcommands.
Overview of PaperMC projects
PaperMC maintains several projects for the Minecraft server ecosystem:
- Paper: A high-performance Minecraft server focused on fixing gameplay and mechanics inconsistencies.
- Velocity: A modern, next-generation Minecraft server proxy.
- Folia: A fork of Paper that implements regionized multithreading for dedicated servers.
- Adventure: A Java library for managing server-controllable user interface elements in Minecraft: Java Edition.
- Waterfall: A discontinued BungeeCord proxy fork (no longer recommended for new setups).
Overview of Paper server configuration files
Paper uses several configuration files located in the server root and theconfig/directory to manage server behavior, world settings, and plugin data.- config/paper-global.yml: Global server configuration - config/paper-world-defaults.yml: Default settings for all worlds - world/dimensions/<namespace>/<key>/paper-world.yml: Per-world overrides - server.properties: Standard Minecraft server properties - spigot.yml: Spigot-specific configuration - bukkit.yml: Bukkit-specific configuration - commands.yml: Command aliases and configuration - eula.txt: EULA consent status - ops.json, whitelist.json, banned-players.json, banned-ips.json: Vanilla data filesIntroduction to MiniMessage format
MiniMessage is a simple string representation of chat components designed for end-users and developers. It uses a tag-based system for styling and interactivity.Hello <rainbow>world</rainbow>, isn't <blue><u><click:open_url:'https://docs.papermc.io/adventure/minimessage/'>MiniMessage</click></u></blue> fun?Overview of Folia Server Multithreading
Folia is a fork of the Paper Minecraft server software. Its primary distinction is the addition of regionized multithreading to the dedicated server, allowing the server to utilize multiple CPU cores by dividing the world into independent regions.Overview of the Paper Dialog API
Introduced in version 1.21.7, the Dialog API allows servers to send custom in-game menus to clients. These menus can be used to display information or gather user input and can be shown during either the configuration phase or normal gameplay.Use the PaperMC Diff Viewer for large GitHub diffs
The diffs.dev Diff Viewer is a multi-file rich diff viewer designed to handle GitHub commits, PRs, comparisons, and diff/patch files. It is specifically optimized for large diffs that may cause the standard GitHub viewer to perform poorly or crash, and it includes special handling for second-order diffs. It is available as a web service and via browser extensions for Chrome and Firefox.Web Viewer: https://diffs.dev GitHub Repository: https://github.com/PaperMC/diff-viewerUnderstand the purpose and constraints of the Lifecycle API
The Lifecycle API provides a separate event system designed to fire during the very early stages of server startup, often before
JavaPlugininstances, theMinecraftServerinstance, or server registries have been initialized. This allows developers to hook into the boot process where the standard Bukkit event system is unavailable because it requires aPlugininstance for registration.Key Constraints:
- Plugin Reloading: Using the Lifecycle API may disable the reloading plugins functionality (e.g.,
/bukkit:reloadorServer#reload()). This occurs because plugin reloads require fully unloading the plugin and its classes, which conflicts with events that must run while the plugin is unloaded.
- Plugin Reloading: Using the Lifecycle API may disable the reloading plugins functionality (e.g.,
Access server internals with paperweight-userdev
Thepaperweight-userdevGradle plugin is the supported method for accessing internal server code (NMS) during development. This approach ensures compliance with the Minecraft EULA (by avoiding redistribution of the server JAR) and provides deployed API javadocs and sources within the IDE.Understand and use the Audience API for content delivery
The
AudienceAPI serves as a universal interface for any entity capable of receiving Minecraft media (text, titles, boss bars), including players, command senders, or the console. It allows developers to target a single receiver or a group (e.g., a team, world, or players matching a specific predicate) without writing boilerplate for each type. If a specific action is not applicable to an audience member (e.g., sending a boss bar to a console), the API gracefully degrades the functionality.Common implementations include:
Audience.empty(): An audience that performs no actions.Audience.audience()andForwardingAudience: Implementations that forward actions to every member of the audience.
Understand Minecraft Registries in Paper
In Minecraft, a registry holds a set of values of the same type, each identified by a key (e.g., the ItemType registry). Some registries are defined by the server and sent to the client upon joining, allowing plugins to define custom content like enchantments and biomes. Registries are accessed via theRegistryAccessclass or statically viaRegistryfor built-in registries.Implement commands in Velocity
Commands in Velocity are created by implementing a sub-interface ofcom.velocitypowered.api.command.Command. The choice of implementation depends on the required argument handling and the level of client-side suggestions needed. Available implementations includeBrigadierCommand,SimpleCommand, andRawCommand.