Created
May 20, 2014 21:51
-
-
Save anonymous/66d95b1f893c6b49ced7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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