Posted May 6, 20187 yr if (!world.isRemote && this.data != null) { NBTTagCompound atag = is.getTagCompound(); if (atag == null) atag = new NBTTagCompound(); if (!atag.hasKey(KEY)) { atag.setBoolean(KEY, true); is.setTagCompound(atag); try { is.setTagCompound(JsonToNBT.getTagFromJson(this.data)); is.getTagCompound().setBoolean(KEY, true); } catch (NBTException nbtexception) { LogManager.getLogger(RWBYModels.MODID).error("Couldn't load data tag for " + this.getRegistryName()); } } } atag is the first part of this which is the current data of the item. the portion inside of try is replacing the tag compound from before while this might be all well and good.it doesn't pass along Enchantments which is why I'm curious if there's a way to merge the two data sets rather then completely override the data though I suspect that's not possible just from looking around. though there is this is.getEnchantmentTagList() which would appear to get a retrievable list of the enchantments in the tagcompound though I'm not sure if there is a way to use that data to reapply the enchantments after the data is wiped. **please keep in mind I am not really familiar with nbt stuff so this all could be entirely wrong and I'm missing a simpler way to do this. but live and learn the reason I'm wiping the data in the first place is because the items have attribute modifiers and I don't want those passed to the new item when they transform however I'd like to keep enchantments if possible.
May 6, 20187 yr Author XX figured it out is.gettagcompound().merge(atag) incase someone finds that they need this info cause I didn't notice it for quite awhile
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.