Show variable on player screen

Started by Nerziq on

Topic category: Help with modding (Java Edition)

Last seen on 16:31, 19. Jun 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Show variable on player screen
Thu, 06/15/2023 - 15:35 (edited)

I created a text and a number variable, I want the text on the player's screen to be equal to this variable, but I can't do it, please help me, I've been trying to do it for several hours (( but my variable is not in the text values \

Edited by Nerziq on Thu, 06/15/2023 - 15:35
Last seen on 00:07, 8. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create an overlay. Add a…
Thu, 06/15/2023 - 12:40

Create an overlay. Add a text element. Edit it, and hit the plus sign to add a procedure.

Add a "return" (the text-colored one) block. Attach a "create text with" block, and go into its settings. Remove one of the items, so there is only one. Then, here, put a procedure to get the value of the variable. It's okay, if your variable is player-specific; the overlay condition checker has the player involved as the event/target entity.

Now, save that and go back to the overlay. Create a condition for the overlay to display. If you want it to always be there, just make a procedure that has a return block and true.

That should be everything. Let me know if you have further questions.