public override net.minecraft.src.ItemStack OnItemRightClick(net.minecraft.src.ItemStack itemstack, net.minecraft.src.World world, net.minecraft.src.EntityPlayer entityplayer ) { itemstack.stackSize--; world.PlaySoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.NextFloat () * 0.4F + 0.8F)); if (!world.singleplayerWorld) { world.AddEntity(new net.minecraft.src.EntityEgg(world, entityplayer)); } return(itemstack); }
public override net.minecraft.src.ItemStack OnItemRightClick(net.minecraft.src.ItemStack itemstack, net.minecraft.src.World world, net.minecraft.src.EntityPlayer entityplayer ) { if (entityplayer.inventory.ConsumeInventoryItem(net.minecraft.src.Item.ARROW.ID )) { world.PlaySoundAtEntity(entityplayer, "random.bow", 1.0F, 1.0F / (itemRand.NextFloat () * 0.4F + 0.8F)); if (!world.singleplayerWorld) { world.AddEntity(new net.minecraft.src.EntityArrow(world, entityplayer)); } } return(itemstack); }
public override void OnBlockDestroyedByPlayer(net.minecraft.src.World world, int i, int j, int k, int l) { if (world.singleplayerWorld) { return; } if ((l & 1) == 0) { DropBlockAsItem_do(world, i, j, k, new net.minecraft.src.ItemStack(net.minecraft.src.Block .TNT.ID, 1, 0)); } else { net.minecraft.src.EntityTNTPrimed entitytntprimed = new net.minecraft.src.EntityTNTPrimed (world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F); world.AddEntity(entitytntprimed); world.PlaySoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F); } }
public override net.minecraft.src.ItemStack OnItemRightClick(net.minecraft.src.ItemStack itemstack, net.minecraft.src.World world, net.minecraft.src.EntityPlayer entityplayer ) { if (entityplayer.fishEntity != null) { int i = entityplayer.fishEntity.CatchFish(); itemstack.DamageItem(i, entityplayer); entityplayer.SwingItem(); } else { world.PlaySoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.NextFloat () * 0.4F + 0.8F)); if (!world.singleplayerWorld) { world.AddEntity(new net.minecraft.src.EntityFish(world, entityplayer)); } entityplayer.SwingItem(); } return(itemstack); }