How to make it so that if a variable is a certain number value it will show a certain overlay or image.

Started by EmeraldMinecart on

Topic category: Help with modding (Java Edition)

Last seen on 08:45, 6. Jul 2024
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make it so that if a variable is a certain number value it will show a certain overlay or image.
Tue, 03/22/2022 - 20:51 (edited)

So im making a magic weapons mod and I've made an overlay that will show a number value of your magic energy but I want an image to show itself when magic energy variable is at a certain amount for example going from fully blue when at 100 to a lighter blue when at 50 and white at 0.

Edited by EmeraldMinecart on Tue, 03/22/2022 - 20:51
Last seen on 08:45, 6. Jul 2024
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Still waiting
Fri, 06/03/2022 - 22:06

Still waiting

Last seen on 11:32, 31. Aug 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'll try to help. I hope I…
Fri, 07/29/2022 - 08:45

I'll try to help. I hope I get it right, so if you put the image in an overlay and on the right (where you can edit the overlay) you have a procedure "display if" (or smth like that). You can make a procedure with an if function in it and when it's true do "return true" and if not, "return false". So if the variable is higher than 50 for example and lower than 75 you can make it appear. Idk if this helped but I hope so.