How to get the return value of a command

Started by reid3002 on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined May 2021
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
How to get the return value of a command

Hi, I wanted to know if there is a way to save the result of, for example, the /data command into a string variable, or any variable at all.

Active 1 year ago
Joined Apr 2021
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 14
Hello! When you create…
Wed, 11/23/2022 - 18:13

Hello!

When you create commands there is something like Parameters and String parameters I think you could use that

Active 2 years ago
Joined May 2021
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 8
Yes, have seen the comand…
Wed, 11/23/2022 - 20:37

Yes, have seen the comand editor and tried to use it for this, but the problem is that I haven't found any way to input the result provided by the /data command into a message or a string. From what I've seen, the comands made in the command editor are only for the player to input data.

Active 1 year ago
Joined Apr 2021
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 14
Oh i see Well you can try to…
Wed, 11/23/2022 - 20:45

Oh i see

Well you can try to save that as nbt tag or global variable for the player

If you only want to send a chat you can put the result in a send chat to all players or message to entity