Skip to content

Katton

面向 Fabric、NeoForge 和 Paper 的可热重载 Kotlin 脚本框架

Banner

Katton Live Preview

Katton能做什么

这些例子或许能告诉你答案

Quick StartAttach JVM Debuggerkotlin
//nessary imports for the script
import net.minecraft.network.chat.Component
import top.katton.api.KattonEvents

// The function with @ServerScriptEntrypoint is the entry point of the script.
@ServerScriptEntrypoint
fun main(){
   // Register an event listener for when a player joins the server
   KattonEvents.ServerPlayer.onPlayerJoin += onJoin@
   fun(arg: KattonEvents.ServerPlayer.PlayerArg){
      // Get the player who joined and send them a message
      val player = arg.player
...