Showcase Item

Showcase Item

7M Downloads

How to change the color of the nickname output in the chat?

Loker541 opened this issue · 3 comments

commented

I write in this format, the color of the nickname remains white:

{
"key.showcaseitem.showcaseitem": "Шифтануть предмет",
"showcaseitem.misc.shared_item": "§8%s§f Демонстрирует предмет:§6 "
}

commented

Then just switch to the 1.19.2 branch:

MutableComponent comp = Component.translatable("showcaseitem.misc.shared_item", player.getName());

commented

It's not possible like that. You will have to change the code here:

MutableComponent comp = Component.translatable("showcaseitem.misc.shared_item", player.getName());
and write comp.setStyle(comp.getStyle().withColor(FastColor.ARGB32.color(r, g, b)))

commented

My Minecraft version is 1.19.2, when building from the sources available here, version showcaseitem-1.21-1.0.0 comes out, the mod does not work in the game after building (the build is successful). Are the available sources relevant for version 1.19.2?

Thanks

It's not possible like that. You will have to change the code here:

MutableComponent comp = Component.translatable("showcaseitem.misc.shared_item", player.getName());

and write comp.setStyle(comp.getStyle().withColor(FastColor.ARGB32.color(r, g, b)))