Started by
Jaysonsup
on
Topic category: Help with Minecraft modding (Java Edition)
Does anybody know how to make a food that makes you stronger everytime you eat it? so lets say the food is a green apple and you eat the green apple and you get 3 extra hearts. How do I make it where the next time you eat that green apple, you get 4 more extra hearts? Who ever can help thanks
https://mcreator.net/wiki/variables look into global variables
You can use a global variable player scoped called for example "eatenApples" (number) or whatever you wanna call it. Then every time you consume your food make a procedure on food consumed that adds +1 to the eatenApples global variable. Then simply check for the number of the variable and make some if statements for controlling the healing. You can also make like a multiplier instead of making like 20 different levels. Just make ["heal the target by [get current health] + 1 x eatenApples]. Hope this helps