--- a/net/minecraft/world/level/storage/loot/LootDataManager.java
+++ b/net/minecraft/world/level/storage/loot/LootDataManager.java
@@ -22,6 +22,8 @@
 import net.minecraft.util.ProblemReporter;
 import net.minecraft.util.profiling.GameProfilerFiller;
 import net.minecraft.world.level.storage.loot.parameters.LootContextParameterSets;
+import org.bukkit.craftbukkit.CraftLootTable;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
 import org.slf4j.Logger;
 
 public class LootDataManager implements IReloadListener, LootDataResolver {
@@ -89,7 +91,7 @@
             @Nullable
             @Override
             public <T> T getElement(LootDataId<T> lootdataid) {
-                return map1.get(lootdataid);
+                return (T) map1.get(lootdataid); // CraftBukkit - decompile error
             }
         });
 
@@ -99,18 +101,25 @@
         problemreporter_a.get().forEach((s, s1) -> {
             LootDataManager.LOGGER.warn("Found loot table element validation problem in {}: {}", s, s1);
         });
+        // CraftBukkit start
+        map1.forEach((key, lootTable) -> {
+            if (object instanceof LootTable table) {
+                table.craftLootTable = new CraftLootTable(CraftNamespacedKey.fromMinecraft(key.location()), table);
+            }
+        });
+        // CraftBukkit end
         this.elements = map1;
         this.typeKeys = com_google_common_collect_immutablemultimap_builder.build();
     }
 
     private static <T> void castAndValidate(LootCollector lootcollector, LootDataId<T> lootdataid, Object object) {
-        lootdataid.type().runValidation(lootcollector, lootdataid, object);
+        lootdataid.type().runValidation(lootcollector, lootdataid, (T) object); // CraftBukkit - decompile error
     }
 
     @Nullable
     @Override
     public <T> T getElement(LootDataId<T> lootdataid) {
-        return this.elements.get(lootdataid);
+        return (T) this.elements.get(lootdataid); // CraftBukkit - decompile error
     }
 
     public Collection<MinecraftKey> getKeys(LootDataType<?> lootdatatype) {
