How to get the return value of a command

Started by reid3002 on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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