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.
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.
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.
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:
With each string as its own entry in the 'combine text' function.
Ye, I know but how?
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.
THX, i have one question, how to change a size of a tooltip?
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.
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