@Override protected void entityInit() { super.entityInit(); dataWatcher.addObject(18, new Float(getHealth())); dataWatcher.addObject(19, new Byte((byte) 0)); dataWatcher.addObject(20, new Byte((byte) BlockColored.func_150032_b(1))); }
/** * Returns true if the item can be used on the given entity, e.g. shears on sheep. * * @param stack the item stack of the item being used * @param player the player who used the item * @param target the target we hit with the item in hand */ public boolean itemInteractionForEntity( ItemStack stack, EntityPlayer player, EntityLivingBase target) { if (target instanceof EntitySheep) { EntitySheep entitysheep = (EntitySheep) target; int i = BlockColored.func_150032_b(stack.getMetadata()); if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != i) { entitysheep.setFleeceColor(i); --stack.stackSize; } return true; } else { return false; } }