Silk sɪlk is a Minecraft API for Kotlin - targetting Fabric, Quilt and Paper.
About
Silk is a bridge between Minecraft and common Kotlin language features, libraries, DSLs and more.
The library offers you stable and simple APIs for common tasks in mod development.
Setup with Gradle
Click on each module below to get started with it and to see how to use it in your build environment.
IMPORTANT Temporary setup requirement
See this gist to learn how to use Silk 1.9.1 and above. This is only temporary, due to Silk already making use of context receivers.
Provide it at runtime
If you use Silk, it must be available at runtime.
You can declare a dependency on the Silk releases on Modrinth or Curseforge.
For users manually downloading your mod you should advise them to download Silk alongside your mod.
All modules:
A command DSL, built on top of Brigadier - the idea of this DSL is to bring the Kotlin builder style to Brigadier. This DSL does not hide vanilla Brigadier from you.
The core module contains simple, stable and lightweight extensions for some Minecraft classes. It does not use any unstable mixins.
Several utilities not fitting for the core module. They can be useful for mini-games, challenges and more - most likely on the server-side.
The Inventory GUI (igui
in short) provides a high level server-side GUI API. You build the GUI using a custom and easy-to-use builder DSL.
Send any serializable class as a packet - using kotlinx.serialization. Provides utilities for sending and receiving packets.
Allows you to persistently store any (serializable) data on chunks, entities (including players), worlds and more.