--- a/net/minecraft/world/level/storage/loot/LootTable.java
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
@@ -30,6 +30,13 @@
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.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 = LogManager.getLogger();
@@ -115,8 +122,21 @@
     }
 
     public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo) {
+        // CraftBukkit start
+        this.fillInventory(iinventory, loottableinfo, false);
+    }
+
+    public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo, boolean plugin) {
+        // CraftBukkit end
         List<ItemStack> list = this.populateLoot(loottableinfo);
         Random random = loottableinfo.a();
+        // CraftBukkit start
+        LootGenerateEvent event = CraftEventFactory.callLootGenerateEvent(iinventory, this, loottableinfo, list, plugin);
+        if (event.isCancelled()) {
+            return;
+        }
+        list = event.getLoot().stream().map(CraftItemStack::asNMSCopy).collect(Collectors.toList());
+        // CraftBukkit end
         List<Integer> list1 = this.a(iinventory, random);
 
         this.a(list, list1.size(), random);
