Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mtndewey.ninjamod.item;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- import com.mtndewey.ninjamod.NinjaMod;
- import com.mtndewey.ninjamod.entity.EntityNinjaStar;
- public class ItemNinjaStar extends Item {
- public ItemNinjaStar() {
- super();
- this.maxStackSize = 64;
- this.setCreativeTab(NinjaMod.tabNinja);
- }
- @Override
- public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
- if (!par3EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
- par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F,
- 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
- if (!par2World.isRemote) {
- par2World.spawnEntityInWorld(new EntityNinjaStar(par2World,
- par3EntityPlayer));
- }
- return par1ItemStack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement