kotlin
object KattonConfigScript-facing config API. Reads config values from the current script's pack manifest.
Usage in scripts:
kotlin
import top.katton.api.*
val rate = config.getNumber("spawn_rate").toDouble()
val prefix = config.getString("message_prefix", "[Default]")
val debug = config.getBool("debug_mode")
val raw = config["some_key"]Each script pack has its own independent config values (from manifest.json "config" field). The current pack is auto-detected from the script execution context.
KattonConfig.get
kotlin
operator fun get(key: String): Any?Get the raw config value by key. Returns null if key not found or pack not resolved.
KattonConfig.getString
kotlin
fun getString(key: String, default: String = ""): StringGet a string config value with an optional default.
KattonConfig.getNumber
kotlin
fun getNumber(key: String, default: Number = 0): NumberGet a numeric config value with an optional default.
KattonConfig.getBool
kotlin
fun getBool(key: String, default: Boolean = false): BooleanGet a boolean config value with an optional default.
KattonConfig.all
kotlin
fun all(): Map<String, Any>Returns all config entries for the current pack.
