In Minecraft I'm able to determine the id of the first item in a chest with the following command:
/data get block <chest coordinates> Items.id
which returns the id as string value. For example if the chest contained stone, the value returned would be "minecraft:stone". I'd like to used this returned value in other commands
For instance you can set an area to be stone with the command:
/fill <start coordinates> <end coorinates> minecraft:stone
What I'd like to do is something to the effect of:
/fill <start coordinates> <end coorinates> run data get block <chest coordinates> Items.id
but this doesn't work. I assume I just have the syntax wrong, but I can't find anything online to give me any guidance.
TLDR: Is there a way to use string values derived from a /data command, in other commands?