Hello! Here is how to make a hunger bar!
Lets get started!
Lets grab a lifecycle and a relay. Both at default settings! Wire them together!
Event Occurs --> Trigger Relay
!
Now wire the relay to the trigger!
Relay Trigger --> Trigger
!
These are the blocks for the Trigger!
This makes it so the property hunger is set 1 less than it was before! Then it checks to see if it is <= 0! If it is, then set it back to 0 and broadcast on “start damaging player”!
There is this really nice devices called never use repeaters! This trigger uses that! It broadcasts on “loop” and triggers on “loop” with a delay of 1! Make sure it is invisible in game and can’t be triggered by a player passing over it!
Grab a damager! Make it damage the player on “start damaging player”! Make it damage however much you’d like!
Grab a property! Name it hunger! Make it player scoped! Make it’s value 100 (number)!
Now for the overlay!
Make a block on “loop”!
Put these blocks in!
If you’d like, change the “|” for an emoji! It doesn’t work on mine, so thats why I chose the line!
It works by setting the food point variable to 1/10th of the hunger property, rounded up! Then in the text it grabs a substring from letter 1 to letter n and sticks it to the end of "Food Points: ".
Now we need a reseting mechanism!
Make a lifecycle for player KO’d and a trigger! Make the trigger trigger when the lifecycle event occurs! Make the blocks this:
This makes it so the player doesn’t keep respawning in an endless loop!
And finally, make it so hunger is obtainable! Just make sure these blocks run when food is found:
Cya Gimkitters, have a


Give me feedback! Anything is welcome!
THE IMAGES ARE NOW FIXED!!!
