--- a/net/minecraft/world/entity/animal/EntityBee.java +++ b/net/minecraft/world/entity/animal/EntityBee.java @@ -243,7 +243,7 @@ } if (b0 > 0) { - ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this); + ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit } } @@ -642,11 +642,15 @@ if (this.isInvulnerable(damagesource)) { return false; } else { - if (!this.level.isClientSide) { + // CraftBukkit start + boolean result = super.damageEntity(damagesource, f); + + if (result && !this.level.isClientSide) { this.beePollinateGoal.l(); } - return super.damageEntity(damagesource, f); + return result; + // CraftBukkit end } } @@ -1216,7 +1220,7 @@ } } - if (flag) { + if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot EntityBee.this.level.triggerEffect(2005, blockposition, 0); EntityBee.this.level.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)); EntityBee.this.fS(); @@ -1289,7 +1293,7 @@ @Override protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) { if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) { - entityinsentient.setGoalTarget(entityliving); + entityinsentient.setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason } } @@ -1298,7 +1302,7 @@ private static class c extends PathfinderGoalNearestAttackableTarget { c(EntityBee entitybee) { - Objects.requireNonNull(entitybee); + // Objects.requireNonNull(entitybee); // CraftBukkit - decompile error super(entitybee, EntityHuman.class, 10, true, false, entitybee::a_); }