Jump to content

TreeBek

Members
  • Posts

    17
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Oklahoma
  • Personal Text
    Im a cat wit armor.

TreeBek's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. kinda worked but it allowed me to get it working how i want it to. Thanks
  2. So i tried that it still does not work.
  3. Well the best way to learn imo is spending hours trying and failing and then eventually succeeding but if you really need to there are tons of tutorials like. or http://www.youtube.com/channel/UC786-fvOTMkndZPRwr15zVA
  4. Have you made an effort to figure it out by yourself?
  5. Hello I'm trying to get a wand to teleport me to the overworld so as expected when i use it it does teleport me to the overworld; however, it then teleports almost instantly teleports me to the nether and i can not figure out for the life of me why can anyoe explain to me why this happens so that i can fix it? public class ItemTeleWand extends Item{ public ItemTeleWand(int par1) { super(par1); this.setCreativeTab(Common.EnchWoodRPGTab); } public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { int BlockId = par3World.getBlockId(par4, par5, par6); int PlayerDimension = par2EntityPlayer.dimension; if(BlockId == Blocks.woodlandPlank.blockID && PlayerDimension != 0){ par2EntityPlayer.travelToDimension(0); return true; }else return false; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Common.modid + ":" + this.getUnlocalizedName().substring(5)); } }
  6. SO i added the null check and it no longer crashes which is good but i don't understand how to get ntb to be something other than null that way my switch statement will be executed. Edit* Well i have been working to figure this out and i have gotten ntb to be things other than null but it only enchants the Sword for a couple milliseconds and then goes back to not being enchanted and lets me do the process over again.
  7. So uh i have no idea what you guys are talking about i have a general understanding of java(just started coding a couple of weeks ago) do you think you could explain how this works?
  8. http://www.mediafire.com/view/i2yti9y5svr09az/ALL_MINECRAFT_SOUND_NAMES_BY_OBBOLALINK.txt
  9. It seems to originate in line int counter = nbt.getInteger("EnchantmentCounter"); //returns 0 if tag doesn't exist, which is fine Btw Draco I liked your Phase stone mod i really enjoyed using it.
  10. I get a crash when i right click.
  11. Well it kind works but i can't figure out how to do it to where i can only give it one enchantment this is what i have so far package Harwood; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.world.World; public class ItemDiamondHarwoodSword extends ItemSword { public ItemDiamondHarwoodSword(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); this.setCreativeTab(HarwoodBase.HarwoodMod); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister){ this.itemIcon = par1IconRegister.registerIcon(HarwoodBase.modid + ":" + (this.getUnlocalizedName().substring(5))); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { int enchantnum = (itemRand.nextInt(6) + 1); int counter = 0; //debug System.out.println("Enchant num " + enchantnum); System.out.println("Counter num " + counter); //debug if(counter <= 0){ switch(enchantnum){ case 1: {par1ItemStack.addEnchantment(Enchantment.fireAspect, 2);} counter++; break; case 2: {par1ItemStack.addEnchantment(Enchantment.baneOfArthropods, 2);} counter++; break; case 3: {par1ItemStack.addEnchantment(Enchantment.knockback, 2);} counter++; break; case 4: {par1ItemStack.addEnchantment(Enchantment.looting, 2);} counter++; break; case 5: {par1ItemStack.addEnchantment(Enchantment.sharpness, 2);} counter++; break; case 6: {par1ItemStack.addEnchantment(Enchantment.smite, 2);} counter++; break; };counter = 1; } return par1ItemStack; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.