Question about progress bars in the GUI

Started by Dilly on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Question about progress bars in the GUI

I have a question about how to add a progress bar to the GUI of a custom furnace. The furnace system itself works fine, but I can't figure out how to change the sprite for my progress bar.

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, does this have to be…
Thu, 03/26/2026 - 08:56

Also, does this have to be done through procedures?

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, it does have to be done…
Thu, 03/26/2026 - 09:59

Yes, it does have to be done through procedures. I've done something similar before, and the best solution I came up with was creating a separate sprite for each progress value, setting each sprite's display condition to a procedure that checks if whatever value (global variable, block NBT value, etc.) is equal to the value you want that progress sprite to be shown at, then layering all the sprites on top of each other.

It's a very convoluted process that takes a lot of repetition, but I've made some working progress bars with it.

Hope this helps :)

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Which module is responsible…
Thu, 03/26/2026 - 10:24

Which module is responsible for changing the sprite in the GUI?

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I'm understanding you…
Thu, 03/26/2026 - 10:27

If I'm understanding you correctly, I think there should be a "Display Condition" or "Sprite Display Condition" procedure slot in the sprite creation/edit menu.

And I'm assuming you already have a value in the block for furnace progress?

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, I have a variable for…
Thu, 03/26/2026 - 11:06

Yes, I have a variable for crafting. But I can't add a procedure to Display Condition

 

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm getting an error:…
Thu, 03/26/2026 - 11:17

I'm getting an error: Procedure that uses return value must always end with a valid return block

 

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You have to make sure that…
Thu, 03/26/2026 - 12:06

You have to make sure that it always returns a value, including in an IF statement.

For example, if you have:

if progress = 1 {

    return true

}

That wouldn't work. You would have to put:

if progress = 1 {

    return true

} else {

    return false

}

That's basically what that error is saying.

Hope this helps! :)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Actually, slight correction,…
Thu, 03/26/2026 - 13:07

Actually, slight correction, to the best of my knowledge, I think that you would actually need:
if progress = 1 {

    return true

}

return false

 

I could be mistaken about this, but I'm pretty sure that you need to have one return block at the end of the procedure outside of an if/else statement. (also, my suggestion basically works the same as LordZintick's second suggestion, because the return block will basically exit out of the procedure, so if it is in an if statement, anything past it will only run if the if statement isn't met.)

Other than that, LordZintick's explanation of the error is accurate.

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, my bad. I forgot that…
Thu, 03/26/2026 - 13:35

Sorry, my bad. I forgot that MCreator doesn't count the return statement in the else block towards the "Procedure that uses return value must always end with a valid return block" thing.

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, I see. I was trying to…
Thu, 03/26/2026 - 13:56

Oh, I see. I was trying to add a `return` statement in the `else` block. I didn't know that MCreator works that way. 

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, it's weird like that…
Thu, 03/26/2026 - 14:22

Yeah, it's weird like that.

Did you get the progress bar working?

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes. Thank you all.
Thu, 03/26/2026 - 16:05

Yes. Thank you all.

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're very welcome!
Thu, 03/26/2026 - 16:17

You're very welcome!