Skip to content

Bukkript is a Bukkit plugin that allows server admins to customize their server easily using Kotlin Scripting and KotlinBukkitAPI.

License

Notifications You must be signed in to change notification settings

GalaxiaOwner/Bukkript

 
 

Repository files navigation

Bukkript

Bukkript

Bukkit Kotlin Script

Kotlin version GitHub stars Github Issues GitHub last commit MIT License Build Status

Bukkript is a Bukkit plugin that allows server admins to customize their server easily with the power of Kotlin language and KotlinBukkitAPI.

Contents:

Features

  • Implicit imports for KotlinBukkitAPI, Bukkit, Kotlin Coroutines
  • Compilation cache
  • Hot Recompilation
  • Per script logging with per script log file.
  • In game commands
  • Additional dependencies by using @file:Maven("DEPENDENCY") and @file:MavenRepository("REPOSITORY URL")
  • IntelliJ Support with KotlinBukkitAPI Tooling

More about the usage at the Documentation.

Installation and Development

  • Download Bukkript and KotlinBukkitAPI
  • Put it in your server Plugin folder.
  • Download the IntelliJ (recommendation is to download it by the app Jetbrains Toolbox)
  • In IntelliJ, go to Setting->Plugins->Marketplace
  • Download KotlinBukkitAPI Tooling
  • Open your server folder
  • Run the server to create the folder plugin/Bukkript/scripts or just create it in the IntelliJ
  • In IntelliJ right click in the scripts folder and New->Bukkript Script
  • Develop it \o/

Example Script

Creating a new command that sends Hello Script World!

test.bk.kts

command("scripttest") {
    executor {
        sender.msg("Hello Script World!")
    }
}

Script with the usage of Jetbrains Exposed

with-dependency.bk.kts

@file:Maven("org.jetbrains.exposed:exposed-core:0.24.1")
@file:Maven("org.jetbrains.exposed:exposed-dao:0.24.1")
@file:Maven("org.jetbrains.exposed:exposed-jdbc:0.24.1")
@file:Maven("org.jetbrains.exposed:exposed-java-time:0.24.1")

val sqlConfig = DatabaseTypeConfig(
        database = "test-server",
        hostname = "localhost",
        user = "root",
        password = "12345",
        port = 3306,
        type = "h2"
)

object MarketTable : IntIdTable("bk-market") {
    val seller = offlinePlayer("seller")
    val item = text("item")
    val price = double("price")
    val postDate = datetime("post_date")
    val isSold = bool("is_sold").default(false)
    val costumer = offlinePlayer("costumer").nullable()
    val soldTime = datetime("sold_time").nullable()
}

val dataSource = databaseTypeFrom(plugin.dataFolder, sqlConfig).dataSource()

val database = Database.connect(dataSource)

transaction(database) {
   SchemaUtils.create(MarketTable)
}

Preview

Hot recompilation

Preview

Credits

Consider donate

Buy Me A Coffee




About

Bukkript is a Bukkit plugin that allows server admins to customize their server easily using Kotlin Scripting and KotlinBukkitAPI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 85.7%
  • Java 14.3%