Ukulib - Library for Fabric Mods
Ukulib is a lightweight library for Fabric mods that requires absolutely no additional dependencies to function.
Main Features
The library offers developers several useful tools:
- Intuitive configuration system with support for creating settings screens in vanilla Minecraft style
- Various utility functions for working with commands, object positioning, and text processing
- Simple integration with other mods through API
Getting Started
To connect the library to your project, add the following lines to the gradle.properties file:
# Link to Ukulib repository
ukulib_version=...
And in build.gradle specify:
repositories {
maven {
url "https://maven.uku3lig.net/releases"
}
}
dependencies {
modApi "net.uku3lig:ukulib:${project.ukulib_version}"
// To include the library directly in your mod
include "net.uku3lig:ukulib:${project.ukulib_version}"
}
Settings Screen Integration
To connect your configuration screen to the Ukulib system, create a class that implements the UkulibAPI interface:
public class YourUkulibAPIClass implements UkulibAPI {
@Override
public Function<Screen, AbstractConfigScreen<?>> supplyConfigScreen() {
return parent -> new YourConfigScreen(parent, ...);
}
}
Then add the corresponding entry to the fabric.mod.json file:
"entrypoints": {
...
"ukulib": [
"your.awesome.mod.YourUkulibAPIClass"
]
}