
XunLib
A common code library designed to ease mod development
About this Mod
Overview
XunLib is a lightweight yet powerful utility library designed to simplify mod development by handling repetitive tasks and offering robust, reusable systems. From inventory management to spatial tools, it provides flexible APIs to minimize boilerplate.
Features
Inventory Utilities
- Insert/extract items, validate stacks, and check container states.
- Armor slot validation for materials/types.
- Convert grid positions to slot indices.
Fuzzy Item Matching
- Compare items by count, enchantments, or custom properties.
- Configurable ignore rules (e.g., ignore durability or Data components).
Smart Effect Application
- Intelligently extend/upgrade existing effects or apply new ones.
Color & Spatial Tools
- Convert between RGB/HSL/HSV and blend colors dynamically.
- Generate shapes (discs, spheres, hollow cubes) and check spatial bounds.
Registration System
- Adding custom items, blocks, and entities in the common module to ease multi-loader development.
Available Versions
How to Install XunLib on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).
Install Mod
Open the mod browser in the dashboard and search for "XunLib". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.1, 1.21
Server-side
✓ RequiredRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
XunLib server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.
Is XunLib compatible with fabric and forge and neoforge?
XunLib officially supports fabric, forge, neoforge for Minecraft 1.21.1, 1.21. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with XunLib – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if XunLib consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install XunLib with just one click on your server.