Can't I do something like this?:
if (par1ItemStack.getInventorySlotContainItem() <
for (int i = 0; i < 40; i++)
{
i = 0;
EntityPlayer entityPlayer = (EntityPlayer)par3Entity;
entityPlayer.heal(1);
par1ItemStack.damageItem(1, entityPlayer);
}
Hello everybody,
I have a question. How can I make it so an item only works while it is in the Hotbar? For example; I have a staff that heals me by half a heart every 5 seconds and takes durability from it. But in order for the staff to do this, it has to be in the item hotbar. I am using Eclipse. I know this is possible because the same thing is done in Equivalent Exchange. You have a flying ring and it lets you fly, but only when it is in you item hotbar. So I basically need to add a new method but I don't know how... If it isn't possible to make it so only if the item is in the hotbar it works, then it still should be possible to make it work when it is in a certain slot. Then I select all the hotbar slots and then I have the hotbar. Any help?
Thanks.
9 replies
Important Information
By using this site, you agree to our Terms of Use.