Posted July 31, 201411 yr Hello, I'm new to creating mods and I'm in the peoccses of making my first mod, and I need some help with it. My mod currntly have 2 items: Flint Bow, and Gunpowder Arrow. I have a question about the Flint bow. I want the flint bow to be able to accept enchantments, and she already knows what to do with them and how to proccess them(e.g. light the arrow in fire if she have the enchant "Flame", etc.) and it have been tested. I don't know how to make her accept enchants in the enchanting table, and right now she only accepts Unbreaking and I don't know why. Thank you for helping.
August 1, 201411 yr Author Did you extend ItemBow? I extanded my items class but copied the bow's code so it will automatically have some methods that all of my items are using, is there any difrence? and btw, can I extanded both my items class and the bow class?
August 1, 201411 yr I extanded my items class but copied the bow's code so it will automatically have some methods that all of my items are using, is there any difrence? and btw, can I extanded both my items class and the bow class? Yes, there's difference, ItemBow is accepted by enchantment table and can be enchanted. No, java doesn't support multiple base classes
August 2, 201411 yr Author Yes, there's difference, ItemBow is accepted by enchantment table and can be enchanted. No, java doesn't support multiple base classes If I will extandened the ItemBow class, what will I do with my Item class? there are methods there that I want all of my items to use so should I copy the methods from there? What should I do with those 2 classes?
August 2, 201411 yr If I will extandened the ItemBow class, what will I do with my Item class? there are methods there that I want all of my items to use so should I copy the methods from there? What should I do with those 2 classes? ItemBow extends Item, if you don't know how that makes sense then learn java before modding
August 2, 201411 yr Author ItemBow extends Item, if you don't know how that makes sense then learn java before modding I said MY Item class wich called ItemFB and have some methods that only MY items have
August 2, 201411 yr Try extending Item in your ItemFB class and overriding getItemEnchantability in your bow class. Although I haven't tried that, but I think something more that 0 will let your item be enchantable.
August 3, 201411 yr Author Try extending Item in your ItemFB class and overriding getItemEnchantability in your bow class. Although I haven't tried that, but I think something more that 0 will let your item be enchantable. This is what I already did and its only allowing me to get the "Unbreaking" enchant, can it be a problem with registering the item? Do I have to register it as a bow? If so, I'm not sure how to do it, so it will be helpful if you will tell me how. I'm registering my items like this: GameRegistry.registerItem(flintBow, "flintBow"); And I saw vanila registering items like that: itemRegistry.addObject(261, "bow", (new ItemBow()).setUnlocalizedName("bow").setTextureName("bow"));
August 3, 201411 yr have you tried different values of enchantability? Gold has 22 for example. The problem is surely not relating to the way the item is registered.
August 3, 201411 yr Author have you tried different values of enchantability? Gold has 22 for example. The problem is surely not relating to the way the item is registered. Well, the vanila bow enchantability is set to 1 so this also was what my bow's enchantability was set to, I tried to set it to 22, no diffrence, still only unbreaking applys to it. btw, the reason I asked about the registering of the item is that I remmeber RWTema (The author of Extra Utilites) talking once about the same problem: his sword wasn't enchantable, and when he fixed it he said that the problem was that the sword wasn't registered as a sword but as a item that heppend to do a lot of damage
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.