--- a/net/minecraft/world/item/ItemUtils.java +++ b/net/minecraft/world/item/ItemUtils.java @@ -41,7 +_,15 @@ public static void onContainerDestroyed(ItemEntity container, Iterable contents) { Level level = container.level(); if (!level.isClientSide) { - contents.forEach(itemStack -> level.addFreshEntity(new ItemEntity(level, container.getX(), container.getY(), container.getZ(), itemStack))); + // Paper start - call EntityDropItemEvent + contents.forEach(stack -> { + ItemEntity droppedItem = new ItemEntity(level, container.getX(), container.getY(), container.getZ(), stack); + org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(container.getBukkitEntity(), (org.bukkit.entity.Item) droppedItem.getBukkitEntity()); + if (event.callEvent()) { + level.addFreshEntity(droppedItem); + } + }); + // Paper end - call EntityDropItemEvent } } }