Skip to content

Conversation

@APickledWalrus
Copy link
Member

Problem

Skript's existing text formatting system is outdated, buggy at times, and heavily integrated with the deprecated Bungeecord Component System. As a result, Skript is missing many of the modern text rendering features available through Adventure. Further, many syntax elements use deprecated methods (or just cannot be implemented) due to missing Component support.

Solution

This PR deprecates and replaces all internal usages of the existing text formatting API in favor of Adventure and MiniMessage. I am finalizing the work and testing, but this is generally ready for reviews. I have included a brief walkthrough of the primary changes below.

The Parser

The main parser is represented within TextComponentParser. This parser contains two MiniMessage instances: one for "safe" parsing (e.g. only color/styling codes) and one for "unsafe" parsing (e.g. hovers, click events). As an example, colored "text" uses the former while formatted "text" uses the latter.

The parser also includes API methods for registering custom tags. This enables addons to register their own formatting codes with Skript's text parser.

Compatibility Efforts

The existing configuration options, link parse mode and colors cause reset have been fully preserved. The former is nicely implemented using the TextReplacement feature of Components, while the latter is somewhat hacked together due to how resets are implemented in MiniMessage.

Legacy formatting codes/tags have also been preserved. There is a compatibility process built in for mapping them to known tags. There is also a compatibility process for supporting color tags with spaces, e.g. <dark red>. One important note is that I have overridden the <u> tag, which is normally used for underlines in MiniMessage, to instead continue behaving as a tag for inserting unicode characters.

There are converters registered for moving between Strings and Components, though Components are preferred whenever possible.

I have updated AnyNamed to include support for Component based operations. The methods are default so that this is non-breaking.

Conversion Efforts

Most, if not all, existing syntax places where Components can be used have been updated to use Components. I took this opportunity to implement several new modules:

  • BlockModule
    • Contains subpackage sign
  • EntityModule
    • Contains subpackage misc and submodule PlayerModule
  • ItemModule
    • Contains subpackages misc and book
  • MiscModule
    • This is in the existing bukkit.misc subpackage. Existing syntax there has not been converted.
  • TextModule
    • Contains the TextComponentParser and text-related syntax, such as message effects and formatting expressions.

For better compatibility (and readability), I have split up ExprMessage into multiple expressions (one per message type/event).

This PR does not implement Component support for chat formatting. That is more complex and will require a dedicated pull request.

Breaking Changes

Many syntax classes have been relocated. If they were being directly referenced, then there will be breaking. I think we should generally consider syntax classes to be internal though.

Other

I have removed the BungeeCord Serializer dependency as it is no longer used.

Testing Completed

No extensive additional tests have been added yet. I performed basic in-game testing. I plan to implement more extensive testing.

Supporting Information


Completes:

Related: none
AI assistance: none

@APickledWalrus APickledWalrus requested review from erenkarakal and removed request for a team December 17, 2025 20:47
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Dec 17, 2025
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good at 75/108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature Pull request adding a new feature. needs reviews A PR that needs additional reviews needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls.

Projects

Status: In Review

3 participants