Skip to content

Instantly share code, notes, and snippets.

@BlockAfterBlock
Created May 31, 2011 00:58
Show Gist options
  • Save BlockAfterBlock/999705 to your computer and use it in GitHub Desktop.
Save BlockAfterBlock/999705 to your computer and use it in GitHub Desktop.
public boolean interact(EntityPlayer entityplayer)
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if(!isChild)
{
if(itemstack != null && itemstack.itemID == Item.stick.shiftedIndex)
{
itemstack.stackSize--;
showHeartsOrSmokeFX(true);
isChild = true;
friendInt = 5;
health = 15;
prevHealth = 0;
ModLoader.getMinecraftInstance().thePlayer.triggerAchievement(mod_Family.TamedSon);
}
if(itemstack != null && Item.itemsList[itemstack.itemID] instanceof ItemFood && !(itemstack.itemID == Item.porkCooked.shiftedIndex || itemstack.itemID == Item.porkRaw.shiftedIndex))
{
itemstack.stackSize--;
showHeartsOrSmokeFX(true);
heal(4); //2 Hearts
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment