Neilon
Neilon is a specialized library for Fabric designed to simplify working with Minecraft's text system. This tool provides developers with a convenient and intuitive way to create and format text elements in the game.
Main Features
The library supports all basic types of text content:
- Direct text and localized strings
- Display of key bindings
- Basic formatting (bold, italic, underlined, strikethrough, magic)
- Full color palette
Interactive Elements
Click Actions
- Execution of game commands
- Command suggestions
- Opening web links
- Copy to clipboard
Hover Events
- Display of text tooltips
- Item information
- Entity data
Convenient Working Methods
The library includes a set of useful methods for everyday development:
- Text repetition
- Working with key bindings
- Localization
- Color management
Automatic Improvements
Neilon automatically fixes common errors:
- Adds
/
prefix to commands when necessary - Corrects URLs by adding
https://
where required
Development Plans
Future versions plan to implement gradient text effects.
Usage Example
NText.assemble()
.text("[Epic Button]")
.color(Color.RED)
.hover("What will this do?")
.click(ClickType.RUN, "kill @s")
.text(" ")
.text("[Another Button]")
.color(Color.GREEN)
.hover(NText.of("I suspect this won't be any better.", Color.GREEN))
.click(ClickType.COPY, "i like trains")
.build();
For comparison, here's how the same code looks using vanilla API:
Text.literal("[Epic Button]")
.styled(style -> style
.withColor(Formatting.RED)
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("What will this do?")
))
.withClickEvent(new ClickEvent(
ClickEvent.Action.RUN_COMMAND,
"kill @s"
))
)
.append(" ")
.append(Text.literal("[Another Button]")
.styled(style -> style
.withColor(Formatting.GREEN)
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("I suspect this won't be any better.")
.styled(s -> s.withColor(Formatting.GREEN))
))
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
"i like trains"
))
)
);