A Spigot library parse/send/manipulate text
jText gives an API to replace text between given tags in a very efficiency and optimized way. It also comes with support
for legacy ampersand minecraft colors, visual components to style your text and support for hex colors and gradients.
Here is an example of the API;
PlaceholderAPI
PlaceholderApi is supported natively, you just have to call `parsePlaceholderAPI()` on the builder and pass a player on
the `parse()` function, just like this:
code=Java]JTextBuilder builder = JText.builder()
.parsePlaceholderAPI();
builder.parse(str, parse);[/code]
Components
Components are a more visual way to style your text. Everything you do will be defined with tags. Tags have a start tag
and an end tag (example: `<bold>Hello`).
All the values of the legacy style can be represented with components, you can see all the values here. Bukkit's colors
are also supported and Java colors too. Examples:
Hex colors
Hex colors are also supported via components, for example `<#ffc0db>This is hex colors!`
![[IMG]](//proxy.spigotmc.org/2cd0705b1807a8725e87314e1cf55e0d9810de4a?url=https%3A%2F%2Fi.imgur.com%2FSwu0njx.png)
jText gives an API to replace text between given tags in a very efficiency and optimized way. It also comes with support
for legacy ampersand minecraft colors, visual components to style your text and support for hex colors and gradients.
Here is an example of the API;
Code (Java):
JTextBuilder builder
= JText.
builder
(
)
// By default, the tag <> is enabled
. withTag ( "\\{", "\\}" ) // Add your custom tag
. withTemplate (Template. of ( "shop", "drops" ) ) // The first value is the text to replace
. withTemplate ( "item", "dirt" ) // and the second is the replacer
. parseHexColors ( ) ; // Enable hex colors parse
String toParse = "You bought 1 of {item} of {shop}"
String parseString = builder. parse (toParse ) ; // Expected: You bought 1 of dirt of drops
. withTag ( "\\{", "\\}" ) // Add your custom tag
. withTemplate (Template. of ( "shop", "drops" ) ) // The first value is the text to replace
. withTemplate ( "item", "dirt" ) // and the second is the replacer
. parseHexColors ( ) ; // Enable hex colors parse
String toParse = "You bought 1 of {item} of {shop}"
String parseString = builder. parse (toParse ) ; // Expected: You bought 1 of dirt of drops
PlaceholderApi is supported natively, you just have to call `parsePlaceholderAPI()` on the builder and pass a player on
the `parse()` function, just like this:
code=Java]JTextBuilder builder = JText.builder()
.parsePlaceholderAPI();
builder.parse(str, parse);[/code]
Components
Components are a more visual way to style your text. Everything you do will be defined with tags. Tags have a start tag
and an end tag (example: `<bold>Hello`).
All the values of the legacy style can be represented with components, you can see all the values here. Bukkit's colors
are also supported and Java colors too. Examples:
Code (YAML):
not_enough_money
: '<gray>Ey, You dont have <red><bold>enough money <gold>to buy this item!'
inventory_full : '<gray>Ey, You don't have <magic>enough space <dark_green>in your inventory!'
not_enough_items : '<pink><italic>You dont have this item or the proper amount to sell it'
inventory_full : '<gray>Ey, You don't have <magic>enough space <dark_green>in your inventory!'
not_enough_items : '<pink><italic>You dont have this item or the proper amount to sell it'
Hex colors are also supported via components, for example `<#ffc0db>This is hex colors!`
![[IMG]](http://proxy.spigotmc.org/2cd0705b1807a8725e87314e1cf55e0d9810de4a?url=https%3A%2F%2Fi.imgur.com%2FSwu0njx.png)
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9, 1.10
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
jText is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 87 times (via Spigot). Download it and open it directly in the game.