Advertisement
Guest User

Untitled

a guest
Aug 9th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package com.halestormxv.item;
  2.  
  3. import java.util.List;
  4.  
  5. import com.halestormxv.entity.EntityGrenade;
  6.  
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.ItemStack;
  10. import net.minecraft.util.EnumChatFormatting;
  11. import net.minecraft.world.World;
  12.  
  13. public class dimGrenade extends Item {
  14.    
  15.     public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
  16.         this.setMaxStackSize(8);
  17.         if(player.inventory.consumeInventoryItem(CelestialCraft_items.starSeedItem)){
  18.             --itemstack.stackSize;
  19.         }
  20.        
  21.         world.playSoundAtEntity(player, "mob.endermen.portal", 0.7F, 0.4F);
  22.        
  23.         if(!world.isRemote){
  24.             world.spawnEntityInWorld(new EntityGrenade(world, player));
  25.         }
  26.        
  27.         return itemstack;
  28.     }
  29.    
  30.     @Override
  31.     public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
  32.     {
  33.     par3List.add("");
  34.     par3List.add("");
  35.     par3List.add(EnumChatFormatting.DARK_RED + "Celestial Grenades are powerful explosives.");
  36.     par3List.add(EnumChatFormatting.DARK_RED + "They can only be used if Starshards are");
  37.     par3List.add(EnumChatFormatting.DARK_RED + "within your inventory.");
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement