Skip to content

vaniland-mc/mcorouhlin

Repository files navigation

mcorouhlin

Maven Central Build codecov

A Kotlin utility library for minecraft plugins.

Features

Event DSL

plugin.events {
    cancelIf<BlockBreakEvent> { event ->
        event.player.isOp
    }
}

Permissions

enum class Permissions(
    override val node: String,
    override val description: String?,
    override val default: PermissionDefault?,
    override val children: Map<Permission, Boolean>,
) : Permission {
    TEST("mcorouhlin.test", "test permission", PermissionDefault.OP, mapOf()),
    ;
}

Inventory DSL

val inventory = plugin.inventory(Component.text("some inventory")) {
    default(itemStack(Material.LIGHT_GRAY_STAINED_GLASS_PANE))

    slot(1, itemStack(Material.LIGHT_GRAY_STAINED_GLASS_PANE)) {
        // on clicked
    }
}

License

This project is licensed under GPL-3.0. See also LICENCE.

This project is including the following OpenSource project codes: