Java 26.2
/loot
@p/loot
Generate loot into players, blocks, or the world.
/loot give @p loot minecraft:chests/simple_dungeon
Loot targets and sources
The /loot command is a target and a source bolted together: where the items go, and where they come from. That is why the argument order feels unusual. Pick both halves here and the generator assembles them in the right order.
/loot spawn <x> <y> <z> loot <table> rolls the table and drops the items as entities at that spot, which is how you preview or hand out loot without breaking a block or killing a mob.
A loot table, a mined block (with an optional tool context), a killed entity, or a fished item. The target -- spawn, give, insert or replace -- decides where the rolled items go.
Many blocks only drop with the right tool or enchantment. Provide a tool context (for example a Silk Touch or Fortune pickaxe) in the mine source so the table rolls as it would in survival.
Java 26.2
@pGenerate loot into players, blocks, or the world.
/loot give @p loot minecraft:chests/simple_dungeon