Custom Tooltip for GUIS

Started by MrScautHD on Mon, 03/01/2021 - 14:44

Topic category: User side tutorials

Last seen on 13:28, 10. Apr 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Custom Tooltip for GUIS
Sat, 04/10/2021 - 08:17 (edited)

Hi this is my Custom Tooltip Tutoiral for GUIS (1.16.4+)

https://www.youtube.com/watch?v=u6BomfhdYn0&feature=youtu.be

1. You make a GUI

2. You go in the GUIWindow Class

3. You add the Code
 

        if(mouseX > guiLeft + 7 && mouseX < guiLeft + 29 && mouseY > guiTop + 10 && mouseY < guiTop + 77)
        this.renderTooltip(ms, new StringTextComponent("TEXT" + "TEXT"), mouseX, mouseY);
    }

Picture:

code

Second option (to add nbts):

        if (mouseX > guiLeft + 143 && mouseX < guiLeft + 168 && mouseY > guiTop + 21 && mouseY < guiTop + 70)
            this.renderTooltip(ms, new StringTextComponent(((new Object() {
                public double getValue(IWorld world, BlockPos pos, String tag) {
                    TileEntity tileEntity = world.getTileEntity(pos);
                    if (tileEntity != null)
                        return tileEntity.getTileData().getDouble(tag);
                    return -1;
                }
            }.getValue(world, new BlockPos((int) x, (int) y, (int) z), "TEXT of the nbt (number)"))) + " FE / 9000.0 FE"), mouseX, mouseY);
    }

Picture to understand the Scaling:

agfd

Have fun to make nice GUI ToolTips! :D

You need help?

My Discord Tag: MrScautHD#0350

Edited by MrScautHD on Sat, 04/10/2021 - 08:17
Last seen on 11:12, 10. Apr 2021
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
pog
Mon, 03/01/2021 - 15:18

pog

Last seen on 20:28, 9. Apr 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
please post a tutorial video…
Thu, 03/25/2021 - 17:18

please post a tutorial video because i dont understand the java 

Last seen on 13:28, 10. Apr 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
when you need help: My…
Sat, 04/10/2021 - 06:01

when you need help:
My Discord Tag: MrScautHD#0350

I suggest you open a PR or…
Sat, 04/10/2021 - 08:17

I suggest you open a PR or ask one of contributors to open it