Dasik Libary
The core library and API for all Dasik mods, including the Vanilla Outsider collection. You only need this if another mod requires it.
介绍

🧠 Dasik Library
“The universal Hive Mind foundation powering autonomous animal genetics, dynamic GameRules, and high-performance flocking across Minecraft.”
📖 Introduction
Developing modern Minecraft Fabric mods often means facing recurring architectural roadblocks: registering dynamic GameRules on the fly without causing immutable registry lockouts, synchronizing animal genetics and scale attributes across world save cycles, orchestrating swarming and flocking AI without decimating server tick rates, and integrating optional client configuration GUIs without causing fatal ClassNotFoundException crashes on headless dedicated servers.
Dasik Library is the universal standalone foundation engineered to solve these challenges. It provides the high-performance architectural backbone powering every mod across the Vanilla Outsider, Delayed Gratification, and Instant Gratification collections. Designed with strict zero-allocation hot paths, Knot ClassLoader isolation, and modular APIs, it equips developers and players with an enterprise-grade framework for modern Minecraft.
This is a Standalone Universal Core Library / API.
- Universal Single-JAR Standard: Dasik Library ships a single universal cross-version JAR (
>=26.1.2-) using pure SemVer. It seamlessly loads across Minecraft 26.1.2, 26.2, 26.3, and future snapshots.- Both Client & Dedicated Server Ready: Fully compatible with singleplayer clients and multiplayer dedicated servers.
- Zero Standalone Gameplay Bloat: Does not add arbitrary gameplay items or world generation on its own. It runs quietly in the background, providing shared AI, genetics, and registry infrastructure for dependent mods.
✨ Features
🧬 Autonomous Animal Genetics & Breeding API
- Persistent Entity Genetics: Attaches an entity-agnostic genetic data model to living entities via persistent Fabric attachments (
dasik-library:genetics), preserving lineage, UUIDs, and generational traits across world saves. - Triangular Mutation & Outcross Recovery: Implements natural biological breeding math, including triangular mutation distribution, parent trait averaging, multi-tier inbreeding penalties, and genetic outcross recovery.
- Size-Stats Builder & Linked Attributes: Easily bind entity physical scale (
minecraft:scale, customizable from0.1fto3.0f) to secondary attributes (Max Health, Movement Speed, Attack Damage) viaLinkedAttributeRegistrywith linear, inverse, or quadratic scaling. - Genetics-Driven Loot Modification: Uses
GeneticsLootRegistryand loot hooks to dynamically scale drops, meat yields, and resources based on entity size and genetic vitality.
⚙️ Dynamic GameRule Registration & Auto-Translation Engine
- On-Demand Registry Unfreezing: Safely unfreezes
BuiltInRegistries.GAME_RULEat runtime viaMappedRegistryAccessor, allowing consumer mods and addons to register custom GameRules without startup race conditions or registry lockouts. - Automatic Translation Injection: Dynamically generates human-readable translation keys and injects them into vanilla’s
Languagemap (dasik$injectDynamicGameRuleTranslations), eliminating missing string placeholders. - World Save Persistence: Seamlessly intercepts
SavedDataserialization (GameRuleMapMixin), ensuring dynamic GameRule changes made via/gamerulepersist reliably inlevel.datandgame_rules.dat. - Automated Orphaned Rule Pruning: Hooks
ServerLifecycleEvents.SERVER_STARTINGto detect and cleanly purge orphaned dynamic GameRules left behind when mods are uninstalled, keeping world save files pristine. - Math Conversion Helpers: Built-in calculation utilities for percentages, permilles, and deciles (
getPct,getChance,getProb,getDecileFloat).
🦅 High-Performance Swarm & Flocking AI (Cached Boids)
- O(N) Leader-Follower Pattern: Eliminates expensive O(N²) pairwise distance checks by computing and caching group metrics (
FlockState) exclusively on the pack Leader, enabling smooth swarms of 100+ entities at a solid 20 TPS. - Biomechanical Steering: Full Alignment, Cohesion, and Separation vector steering calculations for realistic aerial murmurations (
AerialFlockingStrategy) and terrestrial pack movement (TerrestrialFlockingStrategy). - Resilient Following: Integrated water navigation penalty bypass and catch-up teleportation thresholds to ensure pack members never get lost across chunk boundaries.
📡 The Hive Mind & Decoupled Signal Bus
- Decoupled Social Signals: High-throughput
SignalBusenables mobs to emit and receive alerts, warnings, and mood updates across species without hard-coded class couplings. - Scope Isolation: Targeted signal delivery (
Scope.SAME_SPECIES,Scope.HERD,Scope.GLOBAL) with safe instance checks. - Lazy Freeze Architecture: Solves mod initialization race conditions by allowing modules to register social events during mod init while locking the registry safely at server tick.
🖥️ Optional GUI Integration & Server ClassLoader Safety
- Classloader-Isolated Config Screen Resolver:
GuiHelperdynamically discovers and invokes YetAnotherConfigLib (YACL) and Cloth Config via reflection and Knot ClassLoader isolation. - 100% Dedicated Server Crash Immunity: Completely prevents client GUI classes from loading on dedicated servers, eliminating server startup crashes.
- Standardized Creator Support: Provides
DasikSupportHelperto embed standardized creator support buttons across config screen category pages.
🛡️ Enterprise Stability & Zero-Allocation Hot Paths
- Atomic File Persistence:
ConfigHelpermanages JSON read/write operations using temporary file atomic swaps and automatic backup generation. - Zero-Allocation Rendering: Zero-byte heap allocation architecture across high-frequency tick and render paths.
📊 Quick Reference & Mechanics Matrix
| Feature Dimension | Vanilla / Standard Mod Implementation | Dasik Library |
|---|---|---|
| GameRule Registration | Static build-time registration only | Dynamic runtime unfreeze + auto-translation injection |
| Save File Persistence | Only static vanilla rules saved | Dynamic SavedData storage in game_rules.dat |
| Orphaned Rule Handling | Corrupts saves or persists forever | Automated startup pruning (pruneOrphanedRules) |
| Flocking AI Complexity | O(N²) pairwise entity distance loops | O(N) Leader-Cached FlockState computation |
| Animal Genetics Engine | Flat vanilla breed inheritance | Lineage tracking, mutations, scale linking & loot scaling |
| Scale Attribute Range | Rigid vanilla scaling | Custom scaling clamp [0.1f, 3.0f] with linked stats |
| Optional Config GUI | Prone to server NoClassDefFoundError |
Reflection & Knot isolation (GuiHelper) with 0 server risk |
🚀 Developer Quick Start & Implementation Guide
Integrating Dasik Library into your own Fabric mod takes only a few lines of code:
1. Gradle Setup
Add the Modrinth Maven repository and declare the dependency in your build.gradle:
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
dependencies {
modImplementation "maven.modrinth:dasik-library:<latest-version>"
}
2. Registering a Dynamic GameRule
Register a GameRule with automatic English translation and category bolding:
import net.dasik.social.api.gamerule.DynamicGameRuleManager;
// Registers 'my_mod:drop_multiplier' with a default value of 2 under the 'Gameplay' category
DynamicGameRuleManager.registerIntegerRule(
"my_mod:drop_multiplier",
2,
"Drop Multiplier",
"Gameplay"
);
3. Binding Animal Scale to Health and Speed
Link physical size to combat and mobility attributes:
import net.dasik.social.api.genetics.SizeStatsBuilder;
import net.dasik.social.api.genetics.LinkMode;
import net.minecraft.world.entity.ai.attributes.Attributes;
SizeStatsBuilder.create("my_mod:beast_genetics")
.linkAttribute(Attributes.MAX_HEALTH, LinkMode.PROPORTIONAL, 2.0f)
.linkAttribute(Attributes.MOVEMENT_SPEED, LinkMode.INVERSE, 0.5f)
.register();
4. Declaring the Dependency in fabric.mod.json
"depends": {
"fabricloader": ">=0.16.10",
"minecraft": ">=26.1.2-",
"fabric-api": "*",
"dasik-library": ">=1.9.0"
}
⚙️ Core Configuration & Save Architecture
Config vs. In-Game GameRules: The global configuration file only defines default values for newly created worlds. In existing worlds, change settings in-game via the Edit Game Rules UI screen or the
/gamerulecommand.
Dasik Library manages dynamic GameRule states natively within your world save files:
- World Storage: Stored in
<world_save>/data/game_rules.datandlevel.dat. - Zero Residual Clutter: When you remove a mod that registered dynamic rules, Dasik Library’s startup pruning engine detects the absent namespace and unregisters orphaned entries, preventing console spam and bloated save files.
📖 In-Depth How-To & Integration Playbook
1. For Survival Players & Server Administrators
- Download the latest
dasik-library-*.jarrelease. - Place the JAR directly into your
.minecraft/modsfolder along with Fabric API. - Launch Minecraft. Dasik Library operates silently and efficiently in the background, providing foundational services for your installed mods.
- When configuring GameRules in-game via the Edit Game Rules screen or
/gamerule, all rules registered by Dasik-powered mods are automatically translated, organized into categories, and saved directly to the world file.
2. For Modpack Creators
- Universal Multi-Version Support: You do not need separate builds of Dasik Library for minor Minecraft patches — one build handles MC 26.1.2, 26.2, and 26.3+.
- Server-Safe: Include Dasik Library in both client and server modpacks without fear of client GUI crashes.
- Clean World Upgrades: When updating modpacks and removing deprecated mods, the library automatically purges orphaned GameRules on the next server launch.
3. For Mod Developers
- Declare
dasik-libraryin yourfabric.mod.jsonwith version constraint>=1.9.0. - Leverage
DynamicGameRuleManagerto avoid writing repetitive GameRule boilerplate and translation files. - Use
GuiHelperto supply optional YACL or Cloth Config GUIs that open seamlessly via ModMenu while preserving 100% server safety.
🧩 Recommended Sister Mods & Powered Projects
Dasik Library serves as the engine for numerous popular mods. Explore these projects powered directly by the library:
- 📜 Collapsible Game Rules: Modernizes the Edit Game Rules screen into collapsible categories with real-time search, leveraging Dasik Library’s dynamic metadata.
- 🐕 Better Dogs: Complete canine behavioral overhaul featuring personality intelligence, pack murmuration, and vehicle riding powered by Dasik Library’s AI flocking engine.
- 🌿 Natural Reproduction: Autonomous 27-species wildlife breeding and genetics engine built directly on Dasik Animal Genetics.
🌟 Explore my profile for more vanilla enhancements, performance utilities, and game design overhauls.
💬 Join My Discord
Looking for help, want to test early beta builds, or vote on upcoming features? Join my official Discord!
☕ Support
If you enjoy the ecosystem, consider fueling future updates!
🇮🇩 Indonesian Users: SocioBuzz and Saweria support local payment methods (Gopay, OVO, Dana, etc.) if you want to support me without using PayPal/Ko-fi!
📜 Credits & Modpack Permissions
| Role / Property | Author / Link |
|---|---|
| Creator / Author | Dasik (Rifaditya) |
| Community | Official Discord |
| Collection | Universal Core Architecture |
| License | GNU General Public License v3.0 (GPLv3) |
| Source Code | GitHub – Rifaditya/MC-DasikLibrary |
| Issue Tracker | GitHub Issues |
| Documentation / Wiki | GitHub Wiki |
📦 Modpack Permissions & Distribution:
You are fully welcome to include this mod in any modpack on any platform! However, the mod file must be downloaded directly through official distribution channels (Modrinth or CurseForge). Re-uploading, mirroring, or redistributing the original mod JAR to third-party mirror sites, scraper portals, or unauthorized launchers is strictly prohibited.⚖️ License & Fork Guidelines (No Zero-Change Re-uploads):
This project is open-source under the GNU GPLv3. You are fully encouraged to inspect the code, learn from it, and fork the repository to create genuine modifications, substantial feature expansions, or community ports — provided your project remains open-source under GPLv3 with proper attribution.
However, straight 1:1 re-uploads, clone forks with no meaningful functional changes, or re-publishing identical builds under different project names (e.g. to farm downloads or rewards) are strictly forbidden.
常见问题
Dasik Libary 支持哪些 Minecraft 版本?
Dasik Libary 支持 Minecraft Java 版 1.20.1–26.3,共 8 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
Dasik Libary 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
dasikigaijin 的其他作品
查看全部 →
Dasik Library
The core library and API for all Dasik mods, including the Vanilla Outsider collection. You only need this if another mod requires it.
VO: Better Dogs
Enhances vanilla wolves with unique personalities (Aggressive, Pacifist, Normal), smarter AI, safety behaviors, and combat improvements.
VO: Better Dogs
Enhances vanilla wolves with unique personalities (Aggressive, Pacifist, Normal), smarter AI, safety behaviors, and combat improvements.
VO: True Sleep
Don't skip the night—speed it up. A seamless, simulation-preserving sleep overhaul for Minecraft.
评论
登录后评论和评分