How to add Variables in a String

Started by GoldenLambMC on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to add Variables in a String

I'm making a forge mod where when someone consumes a custom item called "Heart", they gain an additional heart to their total. I've been trying a lot of different methods and none have worked. My code starts by setting a local variable to the players health count + 2. Then I run the command "/attribute @p minecraft:generic.max_health base set [Local Variable]. Does anyone know how to out a custom variable in a command prompt. Please check out my code below:

 

Procedure Code: https://pasteboard.co/LMbnJrPKSlHN.png
 

Procedure Triggers: https://pasteboard.co/P74IFGf9cLp0.png

 

Visual Studio Code: https://pasteboard.co/A5yZJIQ5pkny.png
 

Thank you to anyone that helps