Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plutoproject/adventure-kt
⛏️ Full Kotlin support for Kyori Adventure
https://github.com/plutoproject/adventure-kt
adventure bukkit kotlin minecraft minecraft-chat minecraft-plugin paper spigot
Last synced: about 1 month ago
JSON representation
⛏️ Full Kotlin support for Kyori Adventure
- Host: GitHub
- URL: https://github.com/plutoproject/adventure-kt
- Owner: PlutoProject
- License: mit
- Created: 2024-06-10T12:58:30.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-06-24T15:57:20.000Z (5 months ago)
- Last Synced: 2024-10-11T03:03:00.768Z (about 1 month ago)
- Topics: adventure, bukkit, kotlin, minecraft, minecraft-chat, minecraft-plugin, paper, spigot
- Language: Kotlin
- Homepage:
- Size: 117 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# adventure-kt
**English** | [简体中文](https://github.com/PlutoProject/adventure-kt/blob/master/README_CN.md)
> [!WARNING]
>
> This project is still **working in progress**.
>
> Some interfaces may not work / change in the future.
>
> Use it as your own risk.⛏️ Full Kotlin support for [Kyori Adventure](https://github.com/KyoriPowered/adventure).
## 🤔 purpose
Since Kotlin brought us the ability to create [Extensions](https://kotlinlang.org/docs/extensions.html), we can create DSLs.
This project aimed to create many DSL utilities for adventure's builder pattern API, which make your life easier.
## 📦 artifacts
### repository
```kotlin
repositories {
maven(uri("https://maven.nostal.ink/repository/maven-public/"))
}
```### dependency
```kotlin
dependencies {
// Use shadowJar to shade the artifact into your jar
api("ink.pmc.advkt:core:1.0.0-SNAPSHOT")
}tasks.shadowJar {
relocate("ink.pmc.advkt", "com.example.libs.advkt")
}
```## 🗯️ chat
- QQ Group: 682322881
## ☕ examples
### creating a component
```kotlin
component {
text("This is a text component, nothing special.")
text("This is a colorized text component.") with red()
text("This is a colorized text component.") with color(249, 226, 145) // support RGB and hex color
newline()
text("This is a styled text component.") with bold() without italic()
}// you can also use the following syntax
player.send {
text("This is a text component, nothing special.")
}
```### creating a title
```kotlin
title {
mainTitle {
text("This is a main title.")
}
subTitle {
text("This is a sub title.")
}
// support both Kotlin duration and Java duration
times {
fadeIn(1.seconds)
stay(1.seconds)
fadeOut(1.seconds)
}
}
```