Print a variable into chat?

Started by Olipog on

Topic category: Help with MCreator software

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Print a variable into chat?

Hello internet,

I'm working with a variable set to Random (0,1) * 4 + 1 and I'm trying to figure out how to make this variable display in chat. Any and all help is appreciated!

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, so you need your…
Wed, 03/24/2021 - 22:24

Ok, so you need your variable of course, make sure its a number, and find the set variable block. (Make sure this is a local variable). So in custom variables drag Set Local: (variable name) to: And put a purple plus block in, that's in math. Put random 0,1 in one side and in the other do another plus block and do 4 in one and 1 in the other. Then simply put a "Send to chat to all players", then a "create text with" (Click the flower on the block and drag an item out so it only has one connecter), then put a Get Local: (variable name). Hope this fixes your problem! ;) Ps. If it's not working this is for a procedure in the java forge mod maker, and make sure the variable is a local variable you added yourself, make sure the set local is purple along with the get local. I haven't tested but hopefully it works ;) Tell me if it doesn't.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked! Thank you so much!
Thu, 03/25/2021 - 18:02

It worked! Thank you so much!