sigurd4 Posted August 29, 2015 Share Posted August 29, 2015 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. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
sigurd4 Posted August 29, 2015 Author Share Posted August 29, 2015 i'm talking about EnumEnchantmentType.canEnchantItem() Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
ItsAMysteriousYT Posted August 29, 2015 Share Posted August 29, 2015 Well, thats pretty difficult if you don't extend ItemArmor. Quote Link to comment Share on other sites More sharing options...
sigurd4 Posted August 29, 2015 Author Share Posted August 29, 2015 yup. that's why i need help. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
Failender Posted August 29, 2015 Share Posted August 29, 2015 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) Quote Link to comment Share on other sites More sharing options...
sigurd4 Posted August 29, 2015 Author Share Posted August 29, 2015 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 Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
Failender Posted August 29, 2015 Share Posted August 29, 2015 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 Quote Link to comment Share on other sites More sharing options...
sigurd4 Posted August 30, 2015 Author Share Posted August 30, 2015 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. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
sigurd4 Posted August 30, 2015 Author Share Posted August 30, 2015 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. Quote http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod! Link to comment Share on other sites More sharing options...
Recommended Posts
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.