Out command is a simple datapack library that allows to get the output of a command in the SAME tick. As well as running commands in the block entities tick phase.
Command will be processed at the end of the tick by a command block at the edge of the overworld.
To use it simply add an object to the list storage out_command:main commands with the following format:
{
command: string, // Command to get the output of
callback: string, // Command to run after getting the output
}
Getting the current time :
data modify storage out_command:main commands append value { \
command:"help", \
callback:'tellraw @a {nbt:"output.text", storage:"out_command:main", interpret: true}' \
}
The datapack also register a function tag #out_command:tick that runs every tick just before commands in the storage list storage out_command:main commands are processed.