Skip to content

Instantly share code, notes, and snippets.

Created May 20, 2014 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/66d95b1f893c6b49ced7 to your computer and use it in GitHub Desktop.
Save anonymous/66d95b1f893c6b49ced7 to your computer and use it in GitHub Desktop.
package jens.soulcraft.items;
import java.util.Random;
import net.minecraft.entity.monster.EntitySpider;
import jens.soulcraft.common.SoulCraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityEnderPearl;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.world.World;
public class ItemSwordOfTheVoid extends ItemSword{
Random Rand = new Random();
ItemStack Please = new ItemStack(this, 1);
public ItemSwordOfTheVoid(ToolMaterial p_i45356_1_) {
super(p_i45356_1_);
this.setCreativeTab(CreativeTabs.tabCombat);
setTextureName(SoulCraft.MODID+":Sword of the Void");
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par3EntityPlayer.capabilities.isCreativeMode)
{
return Please;
}
else
{
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
Please.setItemDamage(Please.getItemDamage() + 1);
par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
}
}
System.out.println(Please);
return Please;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment