kotlin-forge-api is a repository full of different APIs to be used by mods for Forge 1.8.9 to make modding easier!
Warning! To use any of these modules you must have the Jitpack repo added. To do this simply add
maven {
url "https://jitpack.io"
}
to your build.gradle!
This module simply adds a chat dsl making it easier to forge chat messages
To use this module simply add
implementation "club.chachy.kotlin-forge-api:forge-chat-dsl:0.1.0"
Example:
Minecraft.getMinecraft().thePlayer.sendMessage {
withStyle(green + bold + italic) {
+"It's green, bold AND italic!"
}
+"Boring message"
}
To use this module simply add
implementation "club.chachy.kotlin-forge-api:forge-event-dsl:0.1.0"
Example usage:
on<ClientChatReceivedEvent>()
.filter { it.message.unformattedText.contains("Secret Fullscreen Tactic") }
.subscribe {
it.isCanceled = true
Minecraft.getMinecraft().toggleFullscreen()
}
To use all the modules simply add
implementation "club.chachy.kotlin-forge-api:all:0.1.0"
Example for adding a module:
implementation "club.chachy.kotlin-forge-api:<module-here-example-forge-chat-dsl>:0.1.0"