Strobe RBG text in gui?

Started by f0_olish1 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Strobe RBG text in gui?

I want to make text that will flash the rainbow! in a gui 

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
in the (menuname)Screen code…
Sun, 03/01/2026 - 14:08

in the (menuname)Screen code document, which you can acces by rightclicking on the gui object in the browser and edit in code, there is an override right at the end which should look like this:

and this number: -15728641  which i highlighted in the code represents the color, now you can make a procedure that returns the number that represents your color and link the procedure in the custom code.

for example:
        guiGraphics.drawString(this.font, Component.translatable("gui.test.(guiname).label_(TextId)"), 79, 27, ColorProcedure.Color(), false);

maybe ask chatgpt about the code and make the procedure not locked, just make it return a custom code snippet.

i cant code java, i just figured that out by looking at it so you may seek help from chatgpt in general, but you need to tell it that you are on neoforge 1.21.8 (i think you are on there) a lot so it doesnt give you random code for old forge versions or smth

    @Override

protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
guiGraphics.drawString(this.font, Component.translatable("gui.test.(guiname).label_(TextId)"), 79, 27, -15728641, false);
}