package vgMod.DemonStone; import net.minecraft.entity.boss.EntityDragon; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; public class DemonStaff extends Item { static int number_of_Clicks = 0; public DemonStaff(int par1) { super(par1); setUnlocalizedName("DemonStaff"); setTextureName("vgdemonstone:DemonStaff"); // TODO Auto-generated constructor stub } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){ double x; double y; double z; if(number_of_Clicks == 2){ par3EntityPlayer.addChatMessage("can only spawn 1 at a time"); } if ( number_of_Clicks < 1){ if (par2World.isRemote == false){ x = par3EntityPlayer.posX; y = par3EntityPlayer.posY; z = par3EntityPlayer.posZ; EntityDragon spawnMob = new EntityDragon(par2World); spawnMob.setPositionAndUpdate(x + 5, y + 10,z); par2World.spawnEntityInWorld(spawnMob); number_of_Clicks = 2; } } return par1ItemStack; } }