Posted August 29, 201510 yr i have a bauble that i want to enchant with vanilla enchantments trough an enchantment table, but i do not want my item to extend ItemArmor. however the code for checking wether or not an enchantment is valid for in item checks if the item extends the classes ItemArmor, ItemSword, Item etc. and doesn't call an event or anything like that. the same thing would apply if i were to add a sword or or something that i don't want to extend ItemSword for some reason. is there a way to do this? i've been looking for an event or hook or such but i can't find one. http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
August 29, 201510 yr Author i'm talking about EnumEnchantmentType.canEnchantItem() http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
August 29, 201510 yr Author yup. that's why i need help. http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
August 29, 201510 yr I think we already had this here once.. just with a bow. sad story : you need to recreate every enchantment you want for ur ring x)
August 29, 201510 yr Author jeez really? i feel like i should suggest for the forge guys to add a hook or something like that for this. but thanks, though. i'll add one for every single vanilla enchantment for now. oh well. EDIT: just gonna put this here: http://www.minecraftforge.net/forum/index.php/topic,33408 http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
August 29, 201510 yr well the thing is normally thats not a gud thing. imagine if some1 tries to add a weapon enchantment to an armor? may cause HUGE problems. thats why i think its not in forge and might never be
August 30, 201510 yr Author well, it is possible already by using ItemStack.addEnchantment(), but the standard enchantment table can't do it as it will always check if wether or not the enchantment is valid. i don't think it's gonna be a massive problem at all! and if a modder makes some enchantments do some wierd funky stuff then that is on them, not forge. also i used to mess around with changing nbt tags in vanilla to stuff it shouldn't be and, for example, adding enchantments to an item that shouldn't work on it. adding, say, sharpness to a piece of armor will simply increase the damage dealt when you attack with the armor item (lol), nothing crashes or dies horribly in a fire or anything, so don't worry. http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
August 30, 201510 yr Author i could make my own algoritm for adding random enchantments, though the problem with that is that this algoritm would not be used when the item is enchanted trough an enchantment table, which is kinda what i want. http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
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.