Posted June 27, 201510 yr Is there a way to add "predefined" enchantments for an item? (Especially not using NBTs as shown in vanilla code.)
June 27, 201510 yr Wasnt it Item#addEnchantment? Enchantments ALWAYS need nbt. How else would u store The information?
June 27, 201510 yr Do you mean that when you craft it, it gets enchanted? If yes - there's method in item class - onItemCreated (or something similar) - which gets called when new itemstack with this item is created somewhere. You can do anything you want with itemstack there and resulting stack will change... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 27, 201510 yr There is no need to use that. Just create The recipe and give an enchanted itemstack as output
June 27, 201510 yr There is no need to use that. Just create The recipe and give an enchanted itemstack as output Yes, but this will not work for creative take, dungeon loot, smelting, modded processing, /give... onItemCreated works for everything... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 27, 201510 yr Author Eh, the main problem is, Item#addEnchantment(WhateverArgument whateverName) does not exist EDIT: The real problem is how to somehow get a copy of ItemStack of that Item so I can add Enchantment. (Yes, ItemStack#addEnchantment(...) exists)
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.