Add more hearts

Started by Thedoom19 on Sat, 06/11/2022 - 16:28

Topic category: Help with modding (Java Edition)

Last seen on 13:32, 30. Jul 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Add more hearts
Sat, 06/11/2022 - 16:28

I want it so when you use an item you get 1 heart

Last seen on 13:32, 30. Jul 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(Permanently)
Sat, 06/11/2022 - 16:28

(Permanently)

Last seen on 15:17, 6. Jul 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
idk the full details but…
Sat, 06/11/2022 - 17:49

idk the full details but this requires the health boost effect

when the player uses the item, run a procedure

if the player does not have health boost, give them health boost level 0 (mcreator interprets level 0 as level 1)

if the player has health boost, increase its level by 1

see if that works

Last seen on 01:35, 12. Aug 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can use the "Execute…
Sat, 06/11/2022 - 18:40

You can use the "Execute command /" code block (found under Entity Management) to set the player's max health attribute.

For example, plugging in the following:

attribute @s minecraft:generic.max_health base set 30

will set the max health of the target entity to 30 (15 hearts).

 

NOTE:  Attributes will reset up death, so to make a permanent change, you will have to keep track of the effect with a global variable and reapply it upon player respawn.