Examples of addXpDrop()


Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    getOwner().getData().put(VanillaData.TIME_TILL_EGG, nextEgg);
    setEntityProtocol(new CreatureProtocol(CreatureType.CHICKEN));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.FEATHER, getRandom().nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_CHICKEN, 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(4);
    }
    NearbyMaterialHolderSensor materialHolderSensor = new NearbyMaterialHolderSensor(getAI(), VanillaMaterials.SEEDS);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    setEntityProtocol(new CreatureProtocol(CreatureType.MUSHROOM_COW));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_BEEF, random.nextInt(2) + 1));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.LEATHER, random.nextInt(2)));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
  }
}
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SHEEP));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.WOOL, 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
    NearbyMaterialHolderSensor materialHolderSensor = new NearbyMaterialHolderSensor(getAI(), VanillaMaterials.WHEAT);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    setEntityProtocol(new CreatureProtocol(CreatureType.COW));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_BEEF, random.nextInt(2) + 1));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.LEATHER, random.nextInt(2)));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
    NearbyMaterialHolderSensor materialHolderSensor = new NearbyMaterialHolderSensor(getAI(), VanillaMaterials.WHEAT);
    materialHolderSensor.setSensorRadius(16);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

  public void onAttached() {
    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.PIG));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.RAW_PORKCHOP, getRandom().nextInt(2) + 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
    NearbyMaterialHolderSensor materialHolderSensor = new NearbyMaterialHolderSensor(getAI(), VanillaMaterials.CARROT);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    super.onAttached();
    setEntityProtocol(new CreatureProtocol(CreatureType.SQUID));
    Random random = getRandom();
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(Dye.INK_SAC, random.nextInt(2) + 1));
    dropComponent.addXpDrop((short) (getRandom().nextInt(3) + 1));
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }
  }
}
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    setEntityProtocol(new CreatureProtocol(CreatureType.SPIDER));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.STRING, random.nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.SPIDER_EYE, random.nextInt(1)));
    dropComponent.addXpDrop((short) 5);
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(16);
    }
    Damage damage = getOwner().add(Damage.class);
    damage.getDamageLevel(Difficulty.EASY).setAmount(2);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    physics.setRestitution(0f);

    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    dropComponent.addDrop(new ItemStack(VanillaMaterials.ARROW, random.nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.BONE, random.nextInt(2)));
    dropComponent.addXpDrop((short) 5);

    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(20);
    }
    //TODO: There are 2 kinds of damage for Skeles : Sword & Bow, along with different AI when either is equipped
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    dropComponent.addDrop(new ItemStack(VanillaMaterials.GUNPOWDER, random.nextInt(6)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.REDSTONE_DUST, random.nextInt(6)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.SPIDER_EYE, random.nextInt(6)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.STICK, random.nextInt(6)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.SUGAR, random.nextInt(6)));
    dropComponent.addXpDrop((short) 5);
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(26);
    }

    /*
 
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.DeathDrops.addXpDrop()

    setEntityProtocol(new CreatureProtocol(CreatureType.GHAST));
    DeathDrops dropComponent = getOwner().add(DeathDrops.class);
    Random random = getRandom();
    dropComponent.addDrop(new ItemStack(VanillaMaterials.GUNPOWDER, random.nextInt(2)));
    dropComponent.addDrop(new ItemStack(VanillaMaterials.GHAST_TEAR, random.nextInt(1)));
    dropComponent.addXpDrop((short) 5);
    if (getAttachedCount() == 1) {
      getOwner().add(Health.class).setSpawnHealth(10);
    }

    // Add metadata for red eyes
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.