--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
@@ -60,7 +60,7 @@
     }
 
     public static void lookAtEntity(EntityLiving entityliving, EntityLiving entityliving1) {
-        entityliving.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorPositionEntity(entityliving1, true)));
+        entityliving.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorPositionEntity(entityliving1, true))); // CraftBukkit - decompile error
     }
 
     private static void setWalkAndLookTargetMemoriesToEachOther(EntityLiving entityliving, EntityLiving entityliving1, float f, int i) {
@@ -79,8 +79,8 @@
     public static void setWalkAndLookTargetMemories(EntityLiving entityliving, BehaviorPosition behaviorposition, float f, int i) {
         MemoryTarget memorytarget = new MemoryTarget(behaviorposition, f, i);
 
-        entityliving.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (Object) behaviorposition);
-        entityliving.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) memorytarget);
+        entityliving.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, behaviorposition); // CraftBukkit - decompile error
+        entityliving.getBrain().setMemory(MemoryModuleType.WALK_TARGET, memorytarget); // CraftBukkit - decompile error
     }
 
     public static void throwItem(EntityLiving entityliving, ItemStack itemstack, Vec3D vec3d) {
@@ -90,6 +90,7 @@
     }
 
     public static void throwItem(EntityLiving entityliving, ItemStack itemstack, Vec3D vec3d, Vec3D vec3d1, float f) {
+        if (itemstack.isEmpty()) return; // CraftBukkit - SPIGOT-4940: no empty loot
         double d0 = entityliving.getEyeY() - (double) f;
         EntityItem entityitem = new EntityItem(entityliving.level(), entityliving.getX(), d0, entityliving.getZ(), itemstack);
 
@@ -99,12 +100,19 @@
         vec3d2 = vec3d2.normalize().multiply(vec3d1.x, vec3d1.y, vec3d1.z);
         entityitem.setDeltaMovement(vec3d2);
         entityitem.setDefaultPickUpDelay();
+        // CraftBukkit start
+        org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(entityliving.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity());
+        entityitem.level().getCraftServer().getPluginManager().callEvent(event);
+        if (event.isCancelled()) {
+            return;
+        }
+        // CraftBukkit end
         entityliving.level().addFreshEntity(entityitem);
     }
 
     public static SectionPosition findSectionClosestToVillage(WorldServer worldserver, SectionPosition sectionposition, int i) {
         int j = worldserver.sectionsToVillage(sectionposition);
-        Stream stream = SectionPosition.cube(sectionposition, i).filter((sectionposition1) -> {
+        Stream<SectionPosition> stream = SectionPosition.cube(sectionposition, i).filter((sectionposition1) -> { // CraftBukkit - decompile error
             return worldserver.sectionsToVillage(sectionposition1) < j;
         });
 
