How to call a variable within a function

Started by SlicCer on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to call a variable within a function

I'm trying to change the player's max health. I have a function that is just the normal "attribute @p generic.max_health base set 50". The 50 however is just a placeholder for now until I can figure out how to just call a variable. I really have no idea how I would go about calling the variable from here, or if its even possible.

 

On a different matter however, what name of the function do we use to call it from within a procedure? I've tried using the Function Registry name to call it, as well as the name of the element but both seem to not work. Do we have to add the "namespace:" before it in order for it to get called correctly?