To reproduce
1. create new world
2. create new datapack.
World
->DataPacks
->"Name"
->pack.mcmeta
->Data
->"Name"
->loot_tables
->chests
->test.json
3. create custom loot_tables me for the test I chose a loot tables already existing
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "item",
"name": "minecraft:diamond_sword",
"weight": 1,
"functions": [
{
"function": "set_nbt",
"tag": "{Unbreakable:1}"
}
]
}
]
}
]
}
4. (In game) /setblock ~ ~-1 ~ minecraft:chest{LootTable:"hardel:loot_tables/chests/test"}
Look a chest he is empty
LootTable:"namespace:path/to/loot_table"
datapacks/<pack name>/data/namespace/loot_tables/path/to/loot_table
so in your case you need “test:test” as LootTable.