Posted May 23, 20178 yr Hi. I want to make a custom sword out of a material i made - Ruby but i dont know how to do it. can anyone help me? ( i dont really know any java and i am just following a tutorial and understanding a bit of java)
May 23, 20178 yr 4 hours ago, bhavikchugani said: i dont really know any java That's a real problem. Java is a prerequisite for this forum, so you must go learn it elsewhere or have enough programming experience that you can wing it successfully. In other words, claiming Java ignorance will earn you disdain here, not sympathy. Fortunately, the web is a rich source of help with Java, and the Eclipse IDE is a powerful crutch to the new Java programmer. Best of all, you have all of the decompiled and deobfuscated vanilla source code to explore (and Forge source too). Get out there (exploring the existing Minecraft code base) and learn yourself some Java. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
May 24, 20178 yr Author 22 hours ago, Jay Avery said: Create a subclass of ItemSword that uses your material. how exactly. would this code so far be correct? package items; import com.bhavik.testmod.PickaxeTest; import com.bhavik.testmod.reference; import items.ItemRuby; import net.minecraft.item.Item; public class ItemSword extends Item{ public ItemSword(){ setUnlocalizedName(reference.PickaxeTestItems.RUBYSWORD.getUnlocalizedName()); setRegistryName(reference.PickaxeTestItems.RUBYSWORD.getRegistryName()); setCreativeTab(PickaxeTest.tabPickaxeTest); } }
May 24, 20178 yr 19 minutes ago, bhavikchugani said: how exactly. would this code so far be correct? package items; import com.bhavik.testmod.PickaxeTest; import com.bhavik.testmod.reference; import items.ItemRuby; import net.minecraft.item.Item; public class ItemSword extends Item{ public ItemSword(){ setUnlocalizedName(reference.PickaxeTestItems.RUBYSWORD.getUnlocalizedName()); setRegistryName(reference.PickaxeTestItems.RUBYSWORD.getRegistryName()); setCreativeTab(PickaxeTest.tabPickaxeTest); } } Your class needs to extend ItemSword, not Item.
May 24, 20178 yr Author 55 minutes ago, Jay Avery said: Your class needs to extend ItemSword, not Item. And is ItemSword a minecraft import?? Changed it but getting error for next line of code saying "Implicit Superconstructor ItemSword() is undefined" Edited May 24, 20178 yr by bhavikchugani Addon
May 24, 20178 yr 46 minutes ago, bhavikchugani said: And is ItemSword a minecraft import?? Changed it but getting error for next line of code saying "Implicit Superconstructor ItemSword() is undefined" Yes, ItemSword is a vanilla class in minecraft. The constructor for that class requires parameters, so you need to manually call super in your own constructor and pass the parameters to it.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.