Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vankka/enhancedlegacytext
An alternative input format for Adventure
https://github.com/vankka/enhancedlegacytext
java minecraft
Last synced: about 2 months ago
JSON representation
An alternative input format for Adventure
- Host: GitHub
- URL: https://github.com/vankka/enhancedlegacytext
- Owner: Vankka
- License: mit
- Created: 2021-07-18T20:28:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-20T15:45:05.000Z (5 months ago)
- Last Synced: 2024-10-11T03:22:10.481Z (2 months ago)
- Topics: java, minecraft
- Language: Java
- Homepage:
- Size: 278 KB
- Stars: 19
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# EnhancedLegacyText
[![Maven Central](https://img.shields.io/maven-central/v/dev.vankka/enhancedlegacytext?label=release)](https://central.sonatype.com/search?q=g%3Adev.vankka+a%3Aenhancedlegacytext)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/dev.vankka/enhancedlegacytext?label=dev&server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/#view-repositories;snapshots~browsestorage~dev/vankka)An alternative input format for [Adventure](https://github.com/KyoriPowered/adventure),
building on top of the well known [legacy formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes).## Dependency Information
### Gradle
```groovy
repositories {
mavenCentral()
}dependencies {
implementation 'dev.vankka:enhancedlegacytext:1.0.0'
}
```### Maven
```xmldev.vankka
enhancedlegacytext
1.0.0
compile```
## Basic Usage
```java
Component component = EnhancedLegacyText.get().buildComponent("&c&lThis is red, [click:open_url:https://github.com]this is clickable, this %placeholder% got replaced")
.replace("%placeholder%", Component.text("").color(NamedTextColor.GREEN))
.build();
```## The Format
[Version 2.0.0+ Format](https://github.com/Vankka/EnhancedLegacyText/wiki/Format)
### Color & Formatting
- [The legacy codes](https://minecraft.fandom.com/wiki/Formatting_codes)
+ Exception: Formatting codes remain enabled after color codes (Can be re-enabled via `EnhancedLegacyText.Builder#colorResets`)
- Adventure's hex format, (`` / `abc123`)### Color Gradients
Surrounded by `{` and `}`, seperated by `,`
Examples:
- `{&a,&2,&3}`
- `{&a,aa00,&3}` (mix & match permitted)
- `{7ff55,aa00,aaaa}`## Square Brackets format
### Click & Hover Events
Events are surrounded by `[` and `]`, and split at the first two `:`, first part being either `click` or `hover`
#### Click
Valid types: `open_url`, `run_command`, `suggest_command`, `change_page`, `copy_to_clipboard`
Examples:
- `[click:open_url:https://github.com/Vankka/EnhancedLegacyText]`
- `[click:run_command:say hello]`
- `[click:suggest_command:/help]`
- `[click:change_page:2]`
- `[click:copy_to_clipboard:Secret]`#### Hover
Valid type: `show_text`
Examples:
- `[hover:show_text:Hello]`
- `[hover:show_text:aa00Hello]`