Can I Change the Health Bar?

Started by Jacko22 on

Topic category: Help with MCreator software

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can I Change the Health Bar?

So in the link below I've got a simple procedure which changes the player's health to 100 (ignore the other one, that was for a different post). I just want to know if there is a way to change the obstructive vanilla health (that fills up the screen once it goes past 20) bar to something more streamlined that can portray all 100 HP.

https://imgur.com/a/iomJczz

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Cannot view imgur, try…
Tue, 05/19/2026 - 20:17

Cannot view imgur, try imgbox?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Y'know, is there a less…
Tue, 05/19/2026 - 20:44

Y'know, is there a less resource-intensive way of doing it other than having 400 individual textures for every possible case?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how does the "return logic"…
Wed, 05/20/2026 - 04:16

how does the "return logic" work? When ever I put one in it says "incomplete" but then I add a second, even without anything in it and it works. should the second one say nothing, true, true = true, or something else?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just to elaborate on the…
Wed, 05/20/2026 - 04:18

Just to elaborate on the pictures.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You don’t need the if, the…
Wed, 05/20/2026 - 06:39

You don’t need the if, the problem is you don’t quite understand the logic. All you need is return logic, no other procedure actions, only procedure data if you get what I mean. Simply put return logic, and, health=100, and, health is more than 99, and health is less than 100. You can have as many ands and ors as you like. This is because a condition must be able to return a true AND a false at some point. That is why you needed both a return true and return false when you use an if statement.

As for the 100 images, use a sprite. You can condense all 100 into a single image. Think of it like strips of an image, each strip going down is the next stage of the bar. Mcreator will then split the image into stages and you can call each one through a single procedure.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can send you some images…
Wed, 05/20/2026 - 06:41

I can send you some images later if you need

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry about the double post…
Wed, 05/20/2026 - 16:03

Sorry about the double post Klemen, my browser's been acting odd lately. 

Some images would be very helpful, thank you.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay so a sprite looks like…
Wed, 05/20/2026 - 20:31

Okay so a sprite looks like this where every stage of a 'bar' is represented in layers: https://imgbox.com/cT6786cA

Then you create a sprite element in your gui, the number of sprites is the number of layers so to speak. Then you simply change the sprite number based on another value. Like so: https://imgbox.com/hb2HZtRZ

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You select this return…
Wed, 05/20/2026 - 20:31

You select this return number procedure on your sprite element on index of sprite.

The reason mine has that initial subtraction is due to me putting the full part of the bar at the top of my sprite image, if you put the empty stage at the top of the image then you can remove that entirely.

For all of the return logic and for the extra variants you can do something like this: https://imgbox.com/qzmpCe3L

Let me know of anything else

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Two thing: whenever I import…
Wed, 05/20/2026 - 23:41

Two thing: whenever I import the textures to make then a sprite it forces me into a square aspect ratio, and  I can't figure out how to make the sprite render specific frames with logic. Could you help me out?

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I also tried it out in game…
Wed, 05/20/2026 - 23:43

I also tried it out in game and it had the same x coordinate as in the editor, but not the same y coordinate.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What do you mean it forces…
Thu, 05/21/2026 - 10:51

What do you mean it forces you into a square ratio? The displayed texture shows up as a square in the overlay? Your image will be divided depending on which side is longer, if the image is wider than long then it will be cut into vertical sprites, and vice versa

Show me a picture of both