--- a/net/minecraft/world/entity/animal/EntityPanda.java
+++ b/net/minecraft/world/entity/animal/EntityPanda.java
@@ -69,6 +69,12 @@
 import net.minecraft.world.level.storage.loot.LootTables;
 import net.minecraft.world.phys.Vec3D;
 
+// CraftBukkit start;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityRemoveEvent;
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
 public class EntityPanda extends EntityAnimal {
 
     private static final DataWatcherObject<Integer> UNHAPPY_COUNTER = DataWatcher.defineId(EntityPanda.class, DataWatcherRegistry.INT);
@@ -541,14 +547,14 @@
 
     @Override
     protected void pickUpItem(WorldServer worldserver, EntityItem entityitem) {
-        if (this.getItemBySlot(EnumItemSlot.MAINHAND).isEmpty() && canPickUpAndEat(entityitem)) {
+        if (!CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, !(this.getItemBySlot(EnumItemSlot.MAINHAND).isEmpty() && canPickUpAndEat(entityitem))).isCancelled()) { // CraftBukkit
             this.onItemPickup(entityitem);
             ItemStack itemstack = entityitem.getItem();
 
             this.setItemSlot(EnumItemSlot.MAINHAND, itemstack);
             this.setGuaranteedDrop(EnumItemSlot.MAINHAND);
             this.take(entityitem, itemstack.getCount());
-            entityitem.discard();
+            entityitem.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause
         }
 
     }
@@ -772,7 +778,7 @@
         }
 
         public static EntityPanda.Gene byName(String s) {
-            return (EntityPanda.Gene) EntityPanda.Gene.CODEC.byName(s, (Enum) EntityPanda.Gene.NORMAL);
+            return (EntityPanda.Gene) EntityPanda.Gene.CODEC.byName(s, EntityPanda.Gene.NORMAL); // CraftBukkit - decompile error
         }
 
         public static EntityPanda.Gene getRandom(RandomSource randomsource) {
@@ -876,10 +882,10 @@
         private final EntityPanda panda;
 
         public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
-            Predicate predicate = IEntitySelector.NO_SPECTATORS;
+            // Predicate predicate = IEntitySelector.NO_SPECTATORS;
 
-            Objects.requireNonNull(predicate);
-            super(entitypanda, oclass, f, d0, d1, predicate::test);
+            // Objects.requireNonNull(predicate);
+            super(entitypanda, oclass, f, d0, d1, IEntitySelector.NO_SPECTATORS::test);
             this.panda = entitypanda;
         }
 
@@ -1116,7 +1122,7 @@
         @Override
         protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
             if (entityinsentient instanceof EntityPanda && entityinsentient.isAggressive()) {
-                entityinsentient.setTarget(entityliving);
+                entityinsentient.setTarget(entityliving, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit
             }
 
         }
