Progressive food

Started by Jaysonsup on Thu, 01/20/2022 - 00:10

Topic category: Help with modding (Java Edition)

Last seen on 15:04, 16. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Progressive food
Thu, 01/20/2022 - 00:10

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 

Last seen on 04:24, 12. May 2022
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can use a global…
Fri, 01/21/2022 - 21:41

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