Bar tooltip

Started by Sodz1aX on

Topic category: Help with modding (Java Edition)

Last seen on 19:13, 23. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Bar tooltip

How can i make tooltip for bar of energy that's say "Energy /  MaxEnergy"?

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You would need to make a…
Wed, 01/24/2024 - 16:07

You would need to make a tooltip, then instead of writing text for it, use a procedure to provide text. (You need to make a procedure that returns a string of text, and link it to your tooltip.) The procedure itself would get the energy level, (from whatever variable, NBT tag, or whatever you're using), convert the number to a string, then use a 'combine text' function to combine this with whatever you want the tooltip to say. (It'll combine each bit of text your provide it into one string, that you can then return. Something like:

  • Energy:
  • (The energy number converted to a string.)
  • /
  • (The max energy number converted to a string.)

With each string as its own entry in the 'combine text' function.

Last seen on 19:13, 23. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ye, I know but how?  
Fri, 01/26/2024 - 19:13

Ye, I know but how?

 

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need to use the 'combine…
Fri, 01/26/2024 - 23:37

You need to use the 'combine text' function, and the 'format number as ##.##' functions, found in the text tab. Then you need to return a string, using the 'return string' function in the flow control tab. And you should also have some way of storing the value of the energy, (a variable, or an NBT Tag), that you can use in the function.

Last seen on 19:13, 23. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
THX, i have one question,…
Sat, 01/27/2024 - 13:32

THX, i have one question, how to change a size of a tooltip?

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You'd probably have to…
Sat, 01/27/2024 - 14:35

You'd probably have to change the size manually. (By locking the code element.) I don't know if there's a way to do this using MCreator's built in tools.

Last seen on 23:47, 23. Jul 2024
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if I'm too late…
Thu, 07/11/2024 - 23:41

I don't know if I'm too late, but there is a way to change the size of the tooltip box without code.

GUI Tooltip size | MCreator