public void onAttached() {
super.onAttached();
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);
}
}