--- a/net/minecraft/gametest/framework/StructureUtils.java
+++ b/net/minecraft/gametest/framework/StructureUtils.java
@@ -84,7 +_,7 @@
         level.clearBlockEvents(boundingBox);
         AABB aabb = AABB.of(boundingBox);
         List<Entity> entitiesOfClass = level.getEntitiesOfClass(Entity.class, aabb, entity -> !(entity instanceof Player));
-        entitiesOfClass.forEach(Entity::discard);
+        entitiesOfClass.forEach(entity -> entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD)); // Paper
     }
 
     public static BlockPos getTransformedFarCorner(BlockPos pos, Vec3i offset, Rotation rotation) {
