Java Code Examples for net.minecraft.init.Items.POISONOUS_POTATO

The following are Jave code examples for showing how to use POISONOUS_POTATO of the net.minecraft.init.Items class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Halloween   File: EntityZombieCurse.java   View Source Code Vote up 5 votes
/**
 * Revival zombie curse - fill the player's inventory with poisionous potatoes
 */
private void performRevivalCurse()
{
	EntityPlayer player = (EntityPlayer)this.victim;
	ItemStack stack = new ItemStack(Items.POISONOUS_POTATO, 16 + this.rand.nextInt(17), 0);
	EntityItem entityItem = new EntityItem(this.world, this.posX, this.posY, this.posZ, stack);

	if (player.inventory.addItemStackToInventory(stack))
	{
		ForgeEventFactory.onItemPickup(entityItem, player);
		player.playSound(SoundEvents.ENTITY_ZOMBIE_INFECT, 0.75F, (this.rand.nextFloat() * 0.2F) + 0.9F);
	}
}