gt:             if (!event.isCancelled() && event.getCount() > 0)
context: package net.minecraft.entity.monster;
  
  // CraftBukkit start
  import org.bukkit.craftbukkit.entity.CraftEntity;
  import org.bukkit.craftbukkit.event.CraftEventFactory;
  import org.bukkit.event.entity.EntityTargetEvent;
  import org.bukkit.event.entity.SlimeSplitEvent;
  import net.minecraft.entity.Entity;
  import net.minecraft.entity.EntityLiving;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.item.Item;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraft.util.DamageSource;
  import net.minecraft.util.MathHelper;
  import net.minecraft.world.World;
  import net.minecraft.world.WorldType;
  import net.minecraft.world.biome.BiomeGenBase;
  import net.minecraft.world.chunk.Chunk;
  // CraftBukkit end
  
  public class EntitySlime extends EntityLiving implements IMob
  {
      /** Chances for slimes to spawn in swamps for every moon phase. */
      private static final float[] spawnChances = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F};
      public float field_70813_a;
      public float field_70811_b;
      public float field_70812_c;
  
      /** the time between each jump of the slime */
      private int slimeJumpDelay = 0;
      private Entity lastTarget; // CraftBukkit
  
      public EntitySlime(World par1World)
      {
          super(par1World);
          this.texture = "/mob/slime.png";
          int i = 1 << this.rand.nextInt(3);
          this.yOffset = 0.0F;
          this.slimeJumpDelay = this.rand.nextInt(20) + 10;
          this.setSlimeSize(i);
      }
  
      protected void entityInit()
      {
          super.entityInit();
          this.dataWatcher.addObject(16, new Byte((byte)1));
      }
  
      // CraftBukkit - protected -> public
      public void setSlimeSize(int par1)
      {
          boolean updateMaxHealth = this.getMaxHealth() == this.maxHealth; // CraftBukkit
          this.dataWatcher.updateObject(16, new Byte((byte)par1));
          this.setSize(0.6F * (float)par1, 0.6F * (float)par1);
          this.setPosition(this.posX, this.posY, this.posZ);
  
          // CraftBukkit start
          if (updateMaxHealth)
          {
              this.maxHealth = this.getMaxHealth();
          }
  
          this.setEntityHealth(this.maxHealth);
          // CraftBukkit end
          this.experienceValue = par1;
      }
  
      public int getMaxHealth()
      {
          int i = this.getSlimeSize();
          return i * i;
      }
  
      /**
       * Returns the size of the slime.
       */
      public int getSlimeSize()
      {
          return this.dataWatcher.getWatchableObjectByte(16);
      }
  
      /**
       * (abstract) Protected helper method to write subclass entity data to NBT.
       */
      public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
      {
          super.writeEntityToNBT(par1NBTTagCompound);
          par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1);
      }
  
      /**
       * (abstract) Protected helper method to read subclass entity data from NBT.
       */
      public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
      {
          super.readEntityFromNBT(par1NBTTagCompound);
          this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
      }
  
      /**
       * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate()
       */
      protected String getSlimeParticle()
      {
          return "slime";
      }
  
      /**
       * Returns the name of the sound played when the slime jumps.
       */
      protected String getJumpSound()
      {
          return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
      }
  
      /**
       * Called to update the entity's position/logic.
       */
      public void onUpdate()
      {
          if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
          {
              this.isDead = true;
          }
  
          this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
          this.field_70812_c = this.field_70811_b;
          boolean flag = this.onGround;
          super.onUpdate();
          int i;
  
          if (this.onGround && !flag)
          {
              i = this.getSlimeSize();
  
              for (int j = 0; j < i * 8; ++j)
              {
                  float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
                  float f1 = this.rand.nextFloat() * 0.5F + 0.5F;
                  float f2 = MathHelper.sin(f) * (float)i * 0.5F * f1;
                  float f3 = MathHelper.cos(f) * (float)i * 0.5F * f1;
                  this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)f2, this.boundingBox.minY, this.posZ + (double)f3, 0.0D, 0.0D, 0.0D);
              }
  
              if (this.makesSoundOnLand())
              {
                  this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
              }
  
              this.field_70813_a = -0.5F;
          }
          else if (!this.onGround && flag)
          {
              this.field_70813_a = 1.0F;
          }
  
          this.func_70808_l();
  
          if (this.worldObj.isRemote)
          {
              i = this.getSlimeSize();
              this.setSize(0.6F * (float)i, 0.6F * (float)i);
          }
      }
  
      protected void updateEntityActionState()
      {
          this.despawnEntity();
          // CraftBukkit start
          Entity entityhuman = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); // EntityHuman -> Entity
          EntityTargetEvent event = null;
  
          if (entityhuman != null && !entityhuman.equals(lastTarget))
          {
              event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
          }
          else if (lastTarget != null && entityhuman == null)
          {
              event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, EntityTargetEvent.TargetReason.FORGOT_TARGET);
          }
  
          if (event != null && !event.isCancelled())
          {
              entityhuman = event.getTarget() == null ? null : ((CraftEntity) event.getTarget()).getHandle();
          }
  
          this.lastTarget = entityhuman;
          // CraftBukkit end
  
          if (entityhuman != null)
          {
              this.faceEntity(entityhuman, 10.0F, 20.0F);
          }
  
          if (this.onGround && this.slimeJumpDelay-- <= 0)
          {
              this.slimeJumpDelay = this.getJumpDelay();
  
              if (entityhuman != null)
              {
                  this.slimeJumpDelay /= 3;
              }
  
              this.isJumping = true;
  
              if (this.makesSoundOnJump())
              {
                  this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
              }
  
              this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
              this.moveForward = (float)(1 * this.getSlimeSize());
          }
          else
          {
              this.isJumping = false;
  
              if (this.onGround)
              {
                  this.moveStrafing = this.moveForward = 0.0F;
              }
          }
      }
  
      protected void func_70808_l()
      {
          this.field_70813_a *= 0.6F;
      }
  
      /**
       * Gets the amount of time the slime needs to wait between jumps.
       */
      protected int getJumpDelay()
      {
          return this.rand.nextInt(20) + 10;
      }
  
      protected EntitySlime createInstance()
      {
          return new EntitySlime(this.worldObj);
      }
  
      /**
       * Will get destroyed next tick.
       */
      public void setDead()
      {
          int i = this.getSlimeSize();
  
          if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0)
          {
              int j = 2 + this.rand.nextInt(3);
              // CraftBukkit start
              SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
              this.worldObj.getServer().getPluginManager().callEvent(event);
  
  