--- a/net/minecraft/world/level/storage/loot/LootTable.java
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
@@ -34,6 +34,13 @@
 import org.apache.commons.lang3.ArrayUtils;
 import org.slf4j.Logger;
 
+// CraftBukkit start
+import java.util.stream.Collectors;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.world.LootGenerateEvent;
+// CraftBukkit end
+
 public class LootTable {
 
     static final Logger LOGGER = LogUtils.getLogger();
@@ -145,9 +152,22 @@
     }
 
     public void fill(IInventory iinventory, LootParams lootparams, long i) {
+        // CraftBukkit start
+        this.fillInventory(iinventory, lootparams, i, false);
+    }
+
+    public void fillInventory(IInventory iinventory, LootParams lootparams, long i, boolean plugin) {
+        // CraftBukkit end
         LootTableInfo loottableinfo = (new LootTableInfo.Builder(lootparams)).withOptionalRandomSeed(i).create(this.randomSequence);
         ObjectArrayList<ItemStack> objectarraylist = this.getRandomItems(loottableinfo);
         RandomSource randomsource = loottableinfo.getRandom();
+        // CraftBukkit start
+        LootGenerateEvent event = CraftEventFactory.callLootGenerateEvent(iinventory, this, loottableinfo, objectarraylist, plugin);
+        if (event.isCancelled()) {
+            return;
+        }
+        objectarraylist = event.getLoot().stream().map(CraftItemStack::asNMSCopy).collect(ObjectArrayList.toList());
+        // CraftBukkit end
         List<Integer> list = this.getAvailableSlots(iinventory, randomsource);
 
         this.shuffleAndSplitItems(objectarraylist, list.size(), randomsource);
