Registry API
Paper provides type-safe access to Minecraft’s data-driven registries, allowing you to work with enchantments, biomes, items, and other game content in a safe, version-independent way.What are Registries?
Registries are collections of game content defined by Minecraft’s data-driven system. Examples include:- Enchantments
- Biomes
- Items and blocks
- Entities
- Damage types
- Game events
- Structures
Registry Access
Basic Registry Access
Registry Keys
Paper provides typed constants for registry entries:Available Registries
Enchantments
Biomes
Items and Blocks
Entity Types
Damage Types
Game Events
Instruments
Jukebox Songs
Registry Keys
All available registry key classes:NamespacedKey
All registry entries are identified by NamespacedKeys:Custom Registry Content
While you can’t add new registry entries at runtime (they’re defined by datapacks), you can:- Use datapacks to add custom content
- Check if content exists before using it
- Iterate available content from mods/datapacks
Datapack Integration
Manage datapacks that provide registry content:Registry Best Practices
Registry content is loaded from datapacks and cannot be modified at runtime. Use datapacks to add custom content.
Common Patterns
Safe Registry Access
Registry Iteration
Resources
- Paper Javadocs - Complete registry API reference
- Minecraft Wiki - Data Pack - Creating custom registry content
Next Steps
Datapack Management
Manage datapacks at runtime
Events API
Handle registry-related events