How to get the return value of a command

Started by reid3002 on

Topic category: Help with modding (Java Edition)

Last seen on 19:10, 27. Dec 2022
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.

Last seen on 05:57, 3. Nov 2023
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

Last seen on 19:10, 27. Dec 2022
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.

Last seen on 05:57, 3. Nov 2023
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