KotlinScript
Kotlin Scripting host for Minecraft plugins
Install / Use
/learn @DrZoddiak/KotlinScriptREADME
KotlinScript
KotlinScript is a Sponge plugin that acts as a scripting-host.
This means that Kotlin style scripts can make use of the Spongepowered API.
Wanting to get started? Read our wiki!
What does a script look like?
A script simply needs the file extension of .plugin.kts
You can find many example scripts here; however, a simple example:
import me.zodd.*
import net.kyori.adventure.text.Component
//Without context scripts will execute during construction
Logger.info("Hello Plugin Construction Event")
//Wrapper functions are provided to register events
onServerStarted {
Logger.info("Hello Server Started Event")
}
//Sample first join message
onPlayerJoin {
val player = player()
if (!player.hasPlayedBefore()) {
player.sendMessage(Component.text("Hello ${player.displayName()}"))
/*
Multi-line comments are supported
Returns for events (if used) should use return flags as below
*/
return@onPlayerJoin
}
Logger.info("${player.name()} - ${player.firstJoined()}")
}
How could I possibly script without any auto-completion!?
No need fear! While you can script with a simple text editor you may find that text completion and code suggestions is much easier!
All you need to do is copy the KotlinScriptingExampleRepo, create files with the proper file extension, and start scripting!
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
