How to set custom variables to Max Health?

Started by Cleff. on Mon, 01/24/2022 - 02:43

Topic category: Help with modding (Java Edition)

Last seen on 00:30, 7. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to set custom variables to Max Health?
Mon, 01/24/2022 - 02:43

Hello, I've been playing around with some tools in MCreator and I was wondering if anyone knew how to set a custom variable to the players max health using or not using the attribute command. I'm trying to make a mod that adds Zelda like heart containers. Thank you!

Last seen on 00:30, 7. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I'm going to rewrite that in…
Mon, 01/24/2022 - 03:31

I'm going to rewrite that in an easier way to read because that didn't really make any sense. I want to figure out how to use the attribute command like this:

/attribute @p generic.max_health base set (variable)

Basically I would like to know how to add variables into commands like as seen above. Is it even possible or is there a better alternative? Thank you!

Last seen on 02:51, 19. Feb 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You could achieve that by…
Mon, 01/24/2022 - 05:29

You could achieve that by doing this. Here is what the /attribute part says, "/attribute @p generic.max_health base set placeholder"Max Health

Last seen on 00:30, 7. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you! This worked an I…
Mon, 01/24/2022 - 13:19

Thank you! This worked an I'm really excited to see what this mod is like when it's done.

Last seen on 02:51, 19. Feb 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You're welcome, I'm glad I…
Mon, 01/24/2022 - 19:42

You're welcome, I'm glad I was able to help. I didn't test the procedure in multiplayer and haven't used /execute enough to know for sure, but I would make sure the command works in multiplayer when a player isn't OP and doesn't have permission to use /execute. If it doesn't work, try the other execute procedure block that executes the command at x y z

Last seen on 00:30, 7. Feb 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Got it. Thank you!
Tue, 01/25/2022 - 03:39

Got it. Thank you!