How to set custom variables to Max Health?

Started by Cleff. on

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:
  • MCreator plugins:
  • Comments:
How to set custom variables to Max Health?

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:
  • 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:
  • 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:
  • 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:
  • 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:
  • MCreator plugins:
  • Comments:
Got it. Thank you!
Tue, 01/25/2022 - 03:39

Got it. Thank you!

Last seen on 21:15, 7. Jul 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Where is 'Local: maxHealth'?…
Mon, 04/10/2023 - 04:56

Where is 'Local: maxHealth'?

 

I have found 'Set __ to: __' but there is no 'Local: maxHealth' option.

Last seen on 12:57, 11. Sep 2023
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Creeper you will have to…
Wed, 08/16/2023 - 16:11

Creeper you will have to make the variable in the right side you will see Local variables + X

Press plus and name a variable then set the type to number (I think)