
ChosenLib
ChosenLib: a lightweight utility library for Fabric
- Загрузки
- 1K
- Подписчики
- 0
- Обновлён
- 3 ноября 2025 г.
- Лицензия
- MIT
Опубликован 28 августа 2025 г.
ChosenLib
ChosenLib is a lightweight utility library for Fabric that helps you build mods faster and cleaner. It provides reusable helpers, a modern entrypoint setup, and example mixins—so you can focus on your mod’s features, not boilerplate.
✨ Highlights
- Utility Helpers:
TextUtilsfor clean, localized messages and formatting. - General Utilities: Static helpers for math, string handling, and more.
- Client Conveniences: Example keybinding registration and client-tick hook.
- Mixin Example: Safe template to start patching game behavior.
- Modern Toolchain: Fabric Loader, Fabric API, Java 21, Yarn mappings.
- Developer-Friendly: Sources JAR, sensible Gradle setup, per-env source sets.
🚀 What Can You Use It For?
- Rapidly bootstrap new Fabric mods.
- Share common utilities across multiple projects.
- Use the mixin template as a safe starting point for game tweaks.
📝 Notes
- Works on both client and server unless a feature is explicitly client-only.
- Icon and metadata included—ready for distribution.
- Targeting additional Minecraft versions in future releases.
📄 License
- MIT — use this library in open-source or commercial projects with attribution.
Ченджлог
1.6.0Релиз1.21.1 · 3 ноября 2025 г.
🚀 New in v1.6.0
Major New Utility Classes
FileUtils - File system utilities for safe file operations and data management:
- File operations:
readFile(),writeFile(),copyFile(),moveFile(),deleteFile() - Directory operations:
createDirectory(),listFiles() - File search:
searchFiles()
- File operations:
Command Framework - Easy command creation and management:
- Command Interface: A simple interface for creating commands.
- Command Manager: A centralized manager for registering commands.
General
- Internal version updated to 1.6.0
1.5.1Релиз1.21.1 · 8 октября 2025 г.
🚀 New in v1.5.1
This is a patch release that addresses a critical bug in the networking utility.
- NetworkUtils: Fixed an issue where networking methods were incompatible with the latest Fabric API version. The methods have been updated to use
CustomPayloadfor modern, type-safe packet handling. This is a breaking change for any mods that were using the old networking methods.
Read Full Changelog here: https://urmoit.github.io/ChosenLib/changelog.html or https://github.com/urmoit/ChosenLib/blob/main/Changelogs/CHANGELOG_v1.5.1.md
1.5.0Релиз1.21.1 · 6 октября 2025 г.
🚀 New in v1.5.0
Major New Utility Classes
- 🔧 AdvancedBlockOps - Enhanced block manipulation with safety checks and transactional editing
- 🤖 EntityAIUtils - AI utilities for custom mobs and advanced entity behaviors
- 💾 DataPersistence - World, player, and global data storage with compression
- ✨ EffectsUtils - Sound & particle effect utilities with timing control
- 🌐 AdvancedNetworking - Sophisticated packet handling with encryption and compression
- 🌍 DimensionUtils - Custom dimension management and portal systems
- 🔴 RedstoneUtils - Circuit analysis, automation, and logic gates
- 📊 PerformanceMonitor - Built-in profiling and optimization tools
Enhanced Existing Utilities
- WorldUtils - Transactional editing, undo system, pattern analysis
- EntityUtils - AI integration, enhanced pathfinding, memory system
- NetworkUtils - Reliable packets, compression, encryption
- ItemUtils - Data persistence, advanced validation, custom items
- TextUtils - Rich formatting, performance optimization, localization
Performance Improvements
- Multi-level caching (L1/L2/L3) with intelligent invalidation
- Batch operations for blocks, entities, packets, and items
- Smart object pooling and memory leak detection
Read Full Changelog here: https://urmoit.github.io/ChosenLib/changelog.html or https://github.com/urmoit/ChosenLib/blob/main/Changelogs/CHANGELOG_v1.5.0.md
1.4.0Релиз1.21.1 · 6 сентября 2025 г.
ChosenLib v1.4.0 – Changelog
New in this release
Major New Utility Classes
WorldUtils - World and block manipulation utilities:
- Block operations:
getBlockState(),setBlockState(),isPositionLoaded() - Area queries:
getBlocksInCube(),getBlocksInSphere(),getBlocksInArea() - Block finding:
findBlocks(),findNearestBlock(),replaceBlocks() - World properties:
getBiome(),getLightLevel(),canSeeSky() - Chunk utilities:
getChunk(),isChunkLoaded(),getChunkPos() - Fluid operations:
getFluidState(),hasFluid() - Entity queries:
getEntitiesInBox(),getEntitiesAround(),getNearestEntity()
- Block operations:
EntityUtils - Entity-related helper functions:
- Health management:
getHealth(),setHealth(),heal(),damage() - Status effects:
hasStatusEffect(),addStatusEffect(),removeStatusEffect() - Attributes:
getAttributeValue(),setAttributeBaseValue() - Teleportation:
teleport(),teleportToEntity() - Distance utilities:
getDistance(),isWithinDistance() - Entity finding:
getEntitiesInRadius(),findNearestPlayer() - Physics:
setVelocity(),launchTowards(),knockback() - Player operations:
sendMessage(),giveItem()
- Health management:
NetworkUtils - Networking and packet utilities:
- Packet creation:
createBuffer(),createSimplePacket(),createPositionPacket() - Player targeting:
sendToPlayer(),sendToPlayers(),sendToWorld() - Radius sending:
sendToPlayersInRadius() - Data serialization:
writeString(),writeBlockPos(),writeVec3d(),writeUuid() - Array support:
writeBooleanArray(),writeIntArray(),writeStringArray() - Safe operations:
safeBufferOperation(),hasReadableBytes()
- Packet creation:
Enhanced Existing Utilities
GuiUtils - Now server-side compatible with major enhancements:
- Server-side utilities:
centerX(),centerY(),rgba(),rgb(),withAlpha() - Color operations:
getRed(),getGreen(),getBlue(),getAlpha() - Mathematical:
isPointInRect(),rectanglesOverlap(),distance() - Color manipulation:
hsvToRgb(),adjustBrightness(),interpolateColor() - Progress utilities:
calculateProgressWidth() - Clamping:
clamp()for int, float, and double
- Server-side utilities:
ClientGuiUtils - Client-side rendering extensions:
- Screen utilities:
centerXOnScreen(),centerYOnScreen(),getScreenWidth() - Drawing:
drawRect(),drawBorderedRect(),drawGradient(),drawTexture() - Text rendering:
drawText(),drawCenteredText(),drawTooltip() - UI components:
drawButton(),drawCheckbox(),drawProgressBar() - Text utilities:
getTextWidth(),getTextHeight()
- Screen utilities:
ItemUtils - Performance and feature enhancements:
- Enhanced validation:
canMerge(),isDamageable(),isEnchanted() - Item lookup:
getItemById()for Identifier and String - Durability:
getDurabilityPercentage(),damageItem(),repairItem(),fullyRepairItem() - NBT operations:
getNbt(),setNbt(),hasNbt() - Enchantments:
getEnchantmentLevel(),hasEnchantment() - Inventory:
findFirst(),findAll(),countItem(),consumeItem(),insertStack() - Performance: Caching for
getItemId()andgetMaxStackSize()
- Enhanced validation:
TextUtils - Advanced text operations with performance improvements:
- Interactive text:
clickableCommand(),withTooltip(),interactiveText() - Text wrapping:
wrapText(),createMultiLineTextBox() - Validation:
isBlank(),matches()with pattern caching - Formatting:
formatNumber(),formatDecimal(),formatDuration() - Enhanced utilities:
removeSpecialCharsKeepSpaces(),join()for Lists - Progress bars:
progressBar()with percentage support - Performance: Cached regex patterns and formatting styles
- Interactive text:
Performance Optimizations
- Caching Systems:
- ItemUtils: Concurrent caching for item IDs and stack sizes
- TextUtils: Compiled regex pattern caching and pre-computed styles
- Thread-safe concurrent hash maps for all caches
- Cache statistics and management:
getCacheStats(),clearCache()
Command Improvements
- /chosenlib Command Enhancements:
- Updated to showcase all new v1.4.0 features
- Feature highlights for WorldUtils, EntityUtils, and NetworkUtils
- Improved formatting with success/info message types
- Enhanced user experience with comprehensive feature overview
General
- Internal version updated to 1.4.0
- All utility classes fully documented with comprehensive JavaDoc
- Extensive null safety checks and error handling
- Thread-safe operations across all utilities
- Backward compatibility maintained - no breaking changes
This is a major feature release introducing comprehensive world, entity, and networking utilities with significant performance improvements. All existing code continues to work unchanged and automatically benefits from performance enhancements!
1.3.1Релиз1.21.1 · 6 сентября 2025 г.
ChosenLib v1.3.1 – Changelog
New in this release
Chat Enhancements
- /chosenlib Command Improvements
- Added a clickable Modrinth link to the command output.
- Provides an easy way for players and developers to quickly access the Modrinth page directly from in-game chat.
General
- Internal version updated to 1.3.1.
- Minor improvements to command feedback and user experience.
No breaking changes. This release introduces a convenient Modrinth link button in chat for quicker access to the project page.
1.3.0Релиз1.21.1 · 1 сентября 2025 г.
ChosenLib v1.3.0 – Changelog
New in this release
Major Utility Additions
- GuiUtils - Client-side GUI utility class for Minecraft modding:
- Screen positioning helpers (
centerX(),centerY()) - Color utilities (
rgba(),rgb(),withAlpha(),hsvToRgb()) - Drawing helpers (
drawRect(),drawBorderedRect(),drawGradient()) - Texture rendering (
drawTexture()) - Hit testing (
isPointInRect()) - Progress bars (
drawProgressBar()) - Color manipulation (
adjustBrightness())
- Screen positioning helpers (
Enhanced TextUtils
- Text manipulation:
truncate(),toTitleCase(),reverse(),isPalindrome() - Text validation:
isAlphanumeric(),isValidEmail(),removeSpecialChars() - Text analysis:
wordCount(),centerText(),createTextBox() - Visual elements:
progressBar()- Create text-based progress bars - Advanced formatting:
combine(),stripFormatting(),format()with multiple options - Clickable links:
clickable()- Create clickable chat text with URLs
ItemUtils - Item Management
- Item validation:
isEmpty(),isNotEmpty(),isSameItem(),isExactMatch() - Item information:
getItemId(),getDisplayName(),getMaxStackSize() - Durability utilities:
getDurability(),isDamaged(),getDamagePercentage() - Item manipulation:
copyWithCount(),isStackable()
General
- Internal version updated to 1.3.0.
- All utility classes are fully documented with JavaDoc.
- Improved code organization and structure.
- Fixed API compatibility issues for Minecraft 1.21.1.
- Proper client/server separation with GuiUtils in client source set.
No breaking changes. This release adds comprehensive GUI, text, and item utilities for enhanced mod development!
1.2.1Релиз1.21.1 · 31 августа 2025 г.
ChosenLib v1.2.1 – Changelog
New in this release
/chosenlib Command Improvements
- The
/chosenlibcommand now displays version 1.2.1. - Added a clickable Discord link to the command output.
- All links (CurseForge, Source, Discord) are now clickable in chat:
- License information (MIT) is shown in the command output.
General
- Internal version updated to 1.2.1.
- Minor code and documentation improvements.
No breaking changes. All links are now user-friendly and clickable in Minecraft chat!
1.2.0Релиз1.21.1 · 31 августа 2025 г.
ChosenLib v1.2.0 – Changelog
New in this release
Custom Command System
- Added the
/chosenlibcommand:- Displays the mod version.
- Shows links to CurseForge, Modrinth (coming soon), and the source.
- Informs users that the mod is under the MIT license.
Configuration System
- Introduced a JSON-based config system:
- Config file is auto-generated at
config/chosenlib.json. - Includes example fields and is ready for expansion.
- Config file is auto-generated at
Expanded TextUtils with new helpers
combine(Text... texts): Combine multipleTextobjects into one.stripFormatting(Text text): Get the plain string from aTextobject.format(String message, Formatting... formattings): Format a message with multiple formatting options.- Improved compatibility for formatting methods with modern Minecraft versions.
General Improvements
- Project version bumped to 1.2.0.
No breaking changes. The library is now even more useful for Fabric mod development!
Комментарии
Загружаем…