MonitoringMinecraft MonitoringMinecraft

KFramework

Плагин Paper

Lightweight Kotlin framework for Paper plugin development

21 скачивание 0 подписчиков
Оцените первым

KotlinFramework

Lightweight Kotlin framework for Paper plugin development. Less boilerplate, more plugin.

I built this because I kept copy-pasting the same companion object, instance setup, and registerEvents into every single plugin. It's not trying to replace anything, it just removes the repetitive parts.


Features

  • Base class (KotlinFramework) with automatic instance, startup logging, and safe error handling
  • Inline command registration: no separate class for simple commands
  • Inline event listening: no @EventHandler, no separate Listener class
  • KotlinCommand base class for commands that need their own file
  • Scheduler helpers: runLater, runTimer, runAsync
  • Config helpers: saveLocation, getLocation, config, setConfig
  • Message helpers: msg, broadcastMsg, colorize with & color support

Installation

Add JitPack to your repositories and the framework as a dependency:

repositories {
    maven("https://jitpack.io")
}

dependencies {
    implementation("com.github.kolerz:kframework:1.0.0")
}

⚠️ Use shadowJar to bundle the framework into your plugin jar, otherwise it won't load.


Quick example

class MyPlugin : KotlinFramework() {

    override fun onStart() {

        registerCommand("heal", playerOnly = true) {
            player!!.health = 20.0
            reply("&aHealed!")
        }

        registerCommand("broadcast", permission = "myplugin.broadcast") {
            requireArgs(1, "/broadcast <message>") {
                broadcastMsg("&8[&cBroadcast&8] &f${args.joinToString(" ")}")
            }
        }

        registerListener {
            on<PlayerJoinEvent> {
                player.msg("&aWelcome, &f${player.name}&a!")
            }
        }

        runTimer(0L, 20L * 60L * 5L) {
            broadcastMsg("&eRemember to vote!")
        }
    }
}

Requirements

  • Paper 1.21+
  • Java 21+
  • Kotlin 2.x

Source

github.com/kolerz/kframework


License

MIT

Смотри также

Похожие подборки плагины — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
405 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
PazikCraft
9 онлайн
1.17 — 26.1.2 версия
Ванильное выживание со свадьбами, прокачкой боевых навыков и голосовым чатом
MineLandy
MineLandy Java + BE
30 онлайн
1.12.2 — 26.1.2 версия
Ванила и анархия без приватов — полная свобода действий и честное выживание
Minestory
18 онлайн
1.21 — 26.2 версия
Выживание • Экономика • Кланы • Приваты • Ивенты • PVP • Работа
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат