Namespace

A minecraft namespace where functions, tags, and other datapack content is stored

Created using Datapack.namespace

Example:

val dp = datapack { /* ... */}
val ns = dp.namespace("test")
ns.onLoad {
say("Hello World!")
}

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun advancement(id: String, advancement: Advancement): String

Creates a new minecraft advancement in this namespace

Link copied to clipboard
fun bossbar(id: String = UUID.randomUUID().toString()): Bossbar

Creates a new bossbar with the given id, or a random uuid if no id is given

Link copied to clipboard

Creates a new function with a random UUID as the name

fun function(name: String, c: CommandBuilder.() -> Unit): Func

Creates a new function with the given name

Link copied to clipboard
fun onLoad(c: CommandBuilder.() -> Unit)

Create a new function that runs when the datapack is loaded

Link copied to clipboard
fun onTick(c: CommandBuilder.() -> Unit)

Create a new function that runs every tick

Link copied to clipboard
fun recipe(id: String, recipe: Recipe): String

Creates a new minecraft recipe in this namespace

Link copied to clipboard
fun <T : Discriminant> varEnum(name: String = UUID.randomUUID().toString()): VarEnum<T>

Creates a new scoreboard variable with the given name as player name. If no name is given, a random uuid is used.

Link copied to clipboard
fun varInt(name: String = UUID.randomUUID().toString()): VarInt

Creates a new scoreboard variable with the given name as player name. If no name is given, a random uuid is used.