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:

Link copied to clipboard

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.

Link copied to clipboard

The core module contains simple, stable and lightweight extensions for some Minecraft classes. It does not use any unstable mixins.

Link copied to clipboard

Several utilities not fitting for the core module. They can be useful for mini-games, challenges and more - most likely on the server-side.

Link copied to clipboard

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.

Link copied to clipboard

Provides NBT serialization and deserialization using kotlinx.serialization. Additionally, this module contains some NBT utilities, like simple conversion extensions.

Link copied to clipboard

Send any serializable class as a packet - using kotlinx.serialization. Provides utilities for sending and receiving packets.

Link copied to clipboard

Allows you to persistently store any (serializable) data on chunks, entities (including players), worlds and more.