Skip to content

Full colour and font support for RawText #66

@AmauryCarrade

Description

@AmauryCarrade

Since 20w17a, JSON formatted content accept arbitrary fonts and colours (in hex), like so:

{"text":"Beautiful green","color":"#3f9718", "font": "minecraft:default"}

First thing first, we should accept those in RawText, with something like this:

new RawText("Beautiful green").color("#3f9718").font("minecraft:default")

or:

new RawText("Beautiful green").color(new Color(63, 151, 24)).font(namespacedKey)

Also, I think it would be great if our legacy-to-json converter could accept these colours, using a custom syntax. Something like §#3f9718Green message could do, but if we decide to go this way, it won't be possible to use ChatColor.translateAlternateColorCodes to convert from &-based formatting to §-based, if using this feature.

But it would allow to use arbitrary colours in places where JSON format is accepted while being simple (e.g. in configuration files). With sufficient warnings, it could be really useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C ⋅ ToolsComponent – Uncategorized toolsT ⋅ FeatureType – Feature Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions