Food That increases Health

Started by MapleDude42 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Food That increases Health

How do i make a food (Heart, in my case) that increases health gradually like.

Eating it for the first time gives you a heart then another gives you one more.

and so on. Please if your able to help please do.

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm...You could create an…
Sun, 02/05/2023 - 14:23

Hmm...

You could create an NBT tag for the player that keeps track of how many of these items were eaten. Then, when one is eaten, the procedure below.

The problem with instant health is that it goes by threes, so this will actually be more like the first two give you one, then the next give you three, and so on.

 

Give effect <instant health> lvl round([the NBT tag / 3])
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you don't want to use…
Sun, 02/05/2023 - 14:23

If you don't want to use instant health, then you could use

Set health of (target entity) to [current health of target entity + (the NBT tag + 1)]

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! it works! with a…
Sat, 04/01/2023 - 15:37

Thanks! it works! with a little tweeking tho but THANKS!