Advertisement
Guest User

Untitled

a guest
Nov 15th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1. package vgMod.DemonStone;
  2. import net.minecraft.entity.boss.EntityDragon;
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.item.Item;
  5. import net.minecraft.item.ItemStack;
  6. import net.minecraft.server.MinecraftServer;
  7. import net.minecraft.world.World;
  8.  
  9. public class DemonStaff extends Item {
  10.    
  11.     static int number_of_Clicks = 0;
  12.    
  13.     public DemonStaff(int par1) {
  14.         super(par1);
  15.         setUnlocalizedName("DemonStaff");
  16.         setTextureName("vgdemonstone:DemonStaff");
  17.    
  18.         // TODO Auto-generated constructor stub
  19.     }
  20.    
  21.    
  22. public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
  23.        
  24.        double x;
  25.        double y;
  26.        double z;
  27.      
  28.        if(number_of_Clicks ==  2){
  29.           par3EntityPlayer.addChatMessage("can only spawn 1 at a time");
  30.       }
  31.        
  32.        
  33.        if ( number_of_Clicks < 1){
  34.            if (par2World.isRemote == false){
  35.                  
  36.                 x = par3EntityPlayer.posX;
  37.                 y = par3EntityPlayer.posY;
  38.                 z = par3EntityPlayer.posZ;
  39.            
  40.                EntityDragon spawnMob = new EntityDragon(par2World);
  41.                spawnMob.setPositionAndUpdate(x + 5, y + 10,z);
  42.                par2World.spawnEntityInWorld(spawnMob);
  43.                number_of_Clicks = 2;
  44.            }
  45.                
  46.                    
  47.                }
  48.                
  49.      
  50.        
  51.        return par1ItemStack;
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement