User:Orthotope/mobs

From Minecraft Wiki
Jump to: navigation, search

From minecraft 1.2.3, decompiled with MCP 6.0

EntityXPOrb splits: 1/3/7/17/37/73/149/307/617/1237/2477; usually *2+3

Entity dropItemId normal drops rare drops normal range Looting I Looting II Looting III normal dist Looting dist notes
Living null - none
Animal null - none 1-3 exp
Mob null - none 5 exp
Chicken feather 0-2 + 0-Looting feather
1 raw/cooked chicken
none 0-2 0-3 0-4 0-5 linear triangular
Cow leather 0-2 + 0-Looting leather
1-3 + 0-Looting raw beef/steak
none 0-2 leather
1-3 beef
0-3 leather
1-4 beef
0-4 leather
1-5 beef
0-5 leather
1-6 beef
linear triangular
Pig raw/cooked porkchop 0-2 + 0-Looting raw/cooked porkchop none 0-2 0-3 0-4 0-5 linear triangular
Sheep wool 1 wool if not sheared none 0-1 0-1 0-1 0-1 fixed fixed 5% color 15, 5% color 7, 5% color 8, 3% color 12; otherwise 1/500 color 6, else color 0
equal chances of inheriting wool color from either parent
Squid null 1-(3+Looting) ink sac none 1-3 1-4 1-5 1-6 linear linear only spawn at Y=46 to 62 inclusive
Ocelot null - none 1/3 chance of not spawning when checked, only spawn on leaves or grass
Ender Crystal null - none dies on any attack, explosion strength 6
Ender Dragon null - none crystals heal 1 per 10 ticks, take 10 damage if healing crystal killed
Snow Golem null 0-15 snowballs none 0-15 0-15 0-15 0-15 linear linear
Iron Golem null 0-2 roses
3-5 iron ingot
none 0-2 roses
3-5 iron ingot
0-2 roses
3-5 iron ingot
0-2 roses
3-5 iron ingot
0-2 roses
3-5 iron ingot
linear linear
Blaze null 0-(1+Looting) blaze rod if killed by player none 0-1 0-2 0-3 0-4 linear linear 10 exp
isValidLightLevel() always true, spawn regardless of light
Creeper gunpowder 0-2 + 0-Looting gunpowder none 0-2 0-3 0-4 0-5 linear triangular drop 1 record (type 0-9) if killed by skeleton
Enderman ender pearl 0-(1+Looting) ender pearl none 0-1 0-2 0-3 0-4 linear linear
Ghast null 0-1 + 0-Looting ghast tear
0-2 + 0-Looting gunpowder
none 0-1 ghast tear
0-2 gunpowder
0-2 ghast tear
0-3 gunpowder
0-3 ghast tear
0-4 gunpowder
0-4 ghast tear
0-5 gunpowder
linear triangular
Magma Cube magma cream (-2)-1 + (0-Looting) magma cream, if size > 1 none (-2)-1 (-2)-2 (-2)-3 (-2)-4 linear trianular getTotalArmorValue() = 3*size
Zombie Pigman null 0-(1+Looting) rotten flesh
0-(1+Looting) gold nugget
if enchanted, level 5 gold sword
gold ingot, gold sword, or gold helmet
0-1 rotten flesh
0-1 gold nugget
0-2 rotten flesh
0-2 gold nugget
0-3 rotten flesh
0-3 gold nugget
0-4 rotten flesh
0-4 gold nugget
linear triangular
Skeleton null 0-(2+Looting) arrow
0-(2+Looting) bone
if enchanted, level 5 bow
bow
0-2 arrow
0-2 bone
0-3 arrow
0-3 bone
0-4 arrow
0-4 bone
0-5 arrow
0-5 bone
linear linear
Slime slimeball, if size == 1 0-2 + 0-Looting slimeball none 0-2 0-3 0-4 0-5 linear linear
Spider string 0-2 + 0-Looting string
if killed by player and 1/3 chance, or if (Looting)/(Looting+1), 1 spider eye
none 0-2 string 0-3 string 0-4 string 0-5 string linear triangular effective 1/3, 2/3, 7/9, 5/6 chance of eye with Looting 0-3 (33%, 66%, 78%, 83%)
Zombie rotten flesh 0-2 + 0-Looting rotten flesh iron sword, iron helmet, iron ingot, or iron shovel 0-2 0-3 0-4 0-5 linear triangular

EntityLiving.java:

public void onDeath(DamageSource par1DamageSource)
{
  Entity entity = par1DamageSource.getEntity(); // what killed the mob
  int i = 0;
  if (entity instanceof EntityPlayer) // if killed by player
  {
    i = EnchantmentHelper.getLootingModifier(((EntityPlayer)entity).inventory);
  }
  dropFewItems(recentlyHit > 0, i); // normal drops
  if (recentlyHit > 0)  // needs to be hit by player, but still get rare drops
  {                     // if killed by fire enchantment or something
    int j = rand.nextInt(200) - i; // decreased (better rare drop chances) if player has Looting
    if (j < 5)                     // normal 1 in 40 (2.5%) chance
    {
      func_48085_j_(j > 0 ? 0 : 1);  // and 1 in 5 chance of an enchanted weapon, if possible
    }
  }
}

protected void dropFewItems(boolean par1, int par2)
{
  int i = getDropItemId();
  if (i > 0)
  {
    int j = rand.nextInt(3);
    if (par2 > 0)
    {
      j += rand.nextInt(par2 + 1);
    }
    for (int k = 0; k < j; k++)
    {
      dropItem(i, 1);
    }
  }
}

EntityAnimal.java:

protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
{
  return 1 + worldObj.rand.nextInt(3);
}

EntityMob.java:

 experienceValue = 5;

EntityChicken.java:

timeUntilNextEgg = rand.nextInt(6000) + 6000;

protected int getDropItemId()
{
  return Item.feather.shiftedIndex;
}
 
protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(3) + rand.nextInt(1 + par2);
  for (int j = 0; j < i; j++)
  {
    dropItem(Item.feather.shiftedIndex, 1);
  }
  if (isBurning())
  {
    dropItem(Item.chickenCooked.shiftedIndex, 1);
  }
  else
  {
    dropItem(Item.chickenRaw.shiftedIndex, 1);
  }
} 

EntityCow.java:

protected int getDropItemId()
{
  return Item.leather.shiftedIndex;
}
 
protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(3) + rand.nextInt(1 + par2);
  for (int j = 0; j < i; j++)
  {
    dropItem(Item.leather.shiftedIndex, 1);
  }
  i = rand.nextInt(3) + 1 + rand.nextInt(1 + par2);
  for (int k = 0; k < i; k++)
  {
    if (isBurning())
    {
      dropItem(Item.beefCooked.shiftedIndex, 1);
    }
    else
    {
      dropItem(Item.beefRaw.shiftedIndex, 1);
    }
  }
}

EntityPig.java:

protected int getDropItemId()
{
  if (isBurning())
  {
    return Item.porkCooked.shiftedIndex;
  }
  else
  {
    return Item.porkRaw.shiftedIndex;
  }
}

EntitySheep.java:

protected void dropFewItems(boolean par1, int par2)
{
  if (!getSheared())
  {
    entityDropItem(new ItemStack(Block.cloth.blockID, 1, getFleeceColor()), 0.0F);
  }
}

protected int getDropItemId()
{
  return Block.cloth.blockID;
}

public static int getRandomFleeceColor(Random par0Random)
{
  int i = par0Random.nextInt(100);
  if (i < 5)
  {
    return 15;
  }
  if (i < 10)
  {
    return 7;
  }
  if (i < 15)
  {
    return 8;
  }
  if (i < 18)
  {
    return 12;
  }
  return par0Random.nextInt(500) != 0 ? 0 : 6;
}

public EntityAnimal spawnBabyAnimal(EntityAnimal par1EntityAnimal)
{
  EntitySheep entitysheep = (EntitySheep)par1EntityAnimal;
  EntitySheep entitysheep1 = new EntitySheep(worldObj);
  if (rand.nextBoolean())
  {
    entitysheep1.setFleeceColor(getFleeceColor());
  }
  else
  {
    entitysheep1.setFleeceColor(entitysheep.getFleeceColor());
  }
  return entitysheep1;
}

EntitySquid.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(3 + par2) + 1;
  for (int j = 0; j < i; j++)
  {
    entityDropItem(new ItemStack(Item.dyePowder, 1, 0), 0.0F);
  }
}

public boolean getCanSpawnHere()
{
  return posY > 45D && posY < 63D && super.getCanSpawnHere();
}

EntityOcelot.java:

public boolean getCanSpawnHere()
{
  if (worldObj.rand.nextInt(3) == 0)
  {
    return false;
  }
  if (worldObj.checkIfAABBIsClear(boundingBox) && worldObj.getCollidingBoundingBoxes(this, boundingBox).size() == 0 && !worldObj.isAnyLiquid(boundingBox))
  {
    int i = MathHelper.floor_double(posX);
    int j = MathHelper.floor_double(boundingBox.minY);
    int k = MathHelper.floor_double(posZ);
    if (j < 63)
    {
      return false;
    }
    int l = worldObj.getBlockId(i, j - 1, k);
    if (l == Block.grass.blockID || l == Block.leaves.blockID)
    {
      return true;
    }
  }
  return false;
}

EntityEnderCrystal.java:

public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
{
  if (!isDead && !worldObj.isRemote)
  {
    health = 0;
    if (health <= 0)
    {
      if (!worldObj.isRemote)
      {
        setEntityDead();
        worldObj.createExplosion(null, posX, posY, posZ, 6F);
      }
      else
      {
        setEntityDead();
      }
    }
  }
  return true;
}

EntityDragon.java:

private void updateDragonEnderCrystal()
{
  if (healingEnderCrystal != null)
  {
    if (healingEnderCrystal.isDead)
    {
      if (!worldObj.isRemote)
      {
        attackEntityFromPart(dragonPartHead, DamageSource.explosion, 10);
      }
      healingEnderCrystal = null;
    }
    else if (ticksExisted % 10 == 0 && health < maxHealth)
    {
      health++;
    }
  }

EntitySnowman.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(16);
  for (int j = 0; j < i; j++)
  {
    dropItem(Item.snowball.shiftedIndex, 1);
  }
}

EntityIronGolem.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(3);
  for (int j = 0; j < i; j++)
  {
    dropItem(Block.plantRed.blockID, 1);
  }
  int k = 3 + rand.nextInt(3);
  for (int l = 0; l < k; l++)
  {
    dropItem(Item.ingotIron.shiftedIndex, 1);
  }
}

EntityBlaze.java:

experienceValue = 10;

protected void dropFewItems(boolean par1, int par2)
{
  if (par1)
  {
    int i = rand.nextInt(2 + par2);
    for (int j = 0; j < i; j++)
    {
      dropItem(Item.blazeRod.shiftedIndex, 1);
    }
  }
}

protected boolean isValidLightLevel()
{
  return true;
}

EntityCreeper.java:

public void onDeath(DamageSource par1DamageSource)
{
  super.onDeath(par1DamageSource);

  if (par1DamageSource.getEntity() instanceof EntitySkeleton)
  {
    dropItem(Item.record13.shiftedIndex + rand.nextInt(10), 1);
  }
}

protected int getDropItemId()
{
  return Item.gunpowder.shiftedIndex;
}

EntityEnderman.java:

protected int getDropItemId()
{
  return Item.enderPearl.shiftedIndex;
}

protected void dropFewItems(boolean par1, int par2)
{
  int i = getDropItemId();

  if (i > 0)
  {
    int j = rand.nextInt(2 + par2);

    for (int k = 0; k < j; k++)
    {
      dropItem(i, 1);
    }
  }
}

EntityGhast.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(2) + rand.nextInt(1 + par2);
  for (int j = 0; j < i; j++)
  {
    dropItem(Item.ghastTear.shiftedIndex, 1);
  }
  i = rand.nextInt(3) + rand.nextInt(1 + par2);
  for (int k = 0; k < i; k++)
  {
    dropItem(Item.gunpowder.shiftedIndex, 1);
  }
}

EntityMagmaCube.java:

public int getTotalArmorValue()
{
  return getSlimeSize() * 3;
}

protected int getDropItemId()
{
  return Item.magmaCream.shiftedIndex;
}

protected void dropFewItems(boolean par1, int par2)
{
  int i = getDropItemId();
  if (i > 0 && getSlimeSize() > 1)
  {
    int j = rand.nextInt(4) - 2;
    if (par2 > 0)
    {
      j += rand.nextInt(par2 + 1);
    }
    for (int k = 0; k < j; k++)
    {
      dropItem(i, 1);
    }
  }
}

EntityPigZombie.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(2 + par2); // 0 or 1 drops, more possible if player has Looting
  for (int j = 0; j < i; j++)   // par1 is ignored, same drops if killed by player or mob grinder
  {
    dropItem(Item.rottenFlesh.shiftedIndex, 1);
  }
  i = rand.nextInt(2 + par2);
  for (int k = 0; k < i; k++)
  {
    dropItem(Item.goldNugget.shiftedIndex, 1);
  }
  }

protected void func_48085_j_(int par1)
{
  if (par1 > 0)
  {                            // if drop is flagged as enchanted,
    ItemStack itemstack = new ItemStack(Item.swordGold); //  always produces a sword
    EnchantmentHelper.func_48441_a(rand, itemstack, 5);  // picks the enchantments somehow
    entityDropItem(itemstack, 0.0F);
  }
  else
  {
    int i = rand.nextInt(3); // if not enchanted, equal chances of all rare drops
    if (i == 0)
    {
      dropItem(Item.ingotGold.shiftedIndex, 1);
    }
    else if (i == 1)
    {
      dropItem(Item.swordGold.shiftedIndex, 1);
    }
    else if (i == 2)
    {
      dropItem(Item.helmetGold.shiftedIndex, 1);
    }
  }
}

EntitySkeleton.java:

protected void dropFewItems(boolean par1, int par2)
{
  int i = rand.nextInt(3 + par2);
  for (int j = 0; j < i; j++)
  {
    dropItem(Item.arrow.shiftedIndex, 1);
  }
  i = rand.nextInt(3 + par2);
  for (int k = 0; k < i; k++)
  {
    dropItem(Item.bone.shiftedIndex, 1);
  }
}

protected void func_48085_j_(int par1)
{
  if (par1 > 0)
  {
    ItemStack itemstack = new ItemStack(Item.bow);
    EnchantmentHelper.func_48441_a(rand, itemstack, 5);
    entityDropItem(itemstack, 0.0F);
  }
  else
  {
    dropItem(Item.bow.shiftedIndex, 1);
  }
}

EntitySlime.java:

protected int getDropItemId()
{
  if (getSlimeSize() == 1)
  {
    return Item.slimeBall.shiftedIndex;
  }
  else
  {
    return 0;
  }
}

EntitySpider.java:

protected int getDropItemId()
{
  return Item.silk.shiftedIndex;
}
protected void dropFewItems(boolean par1, int par2)
{
  super.dropFewItems(par1, par2);

  if (par1 && (rand.nextInt(3) == 0 || rand.nextInt(1 + par2) > 0))
  {
    dropItem(Item.spiderEye.shiftedIndex, 1);
  }
}

EntityZombie.java:

protected int getDropItemId()
{
  return Item.rottenFlesh.shiftedIndex;
}

protected void func_48085_j_(int par1)
{
  switch (rand.nextInt(4))
  {
    case 0:
      dropItem(Item.swordSteel.shiftedIndex, 1);
      break;
    case 1:
      dropItem(Item.helmetSteel.shiftedIndex, 1);
      break;
    case 2:
      dropItem(Item.ingotIron.shiftedIndex, 1);
      break;
    case 3:
      dropItem(Item.shovelSteel.shiftedIndex, 1);
      break;
  }
}