TeamDimensional / MultiblockedNBT

Use Multiblocked to modify NBT tags of items.
MIT License
1 stars 0 forks source link

Unenchanting? #1

Open Primitive-Human opened 2 months ago

Primitive-Human commented 2 months ago

Saw this addon recently and wondered if this could be used to transfer any enchantment from a list of equipment onto books? Haven't experimented with it yet.

Wizzerinus commented 2 months ago

You could make a custom handler that does it - you need to implement INBTModifier<ItemStack> to do one of the following:

a) if you want to extract all enchantments: replace the input item with the book (as you see this voids the input item) - only will work with 1.1 b) if you want to extract one enchantment: you'll have to add 1 recipe for each enchantment, and the modifier removes that enchantment from the item, something like that

The framework doesn't allow cross-modifications at the time which is why both of these use cases are a bit annoying to execute (in the ideal world we could have a cross-handler that simultaneously affects 2 input items - the enchanted item and the book). I currently can't think of a good way to resolve it, sadly. If you have any ideas do tell.

Any reason why you are not using something like Industrial Foregoing's enchantment extractor? That seems way better suited for the job than this mod (which is better with semi-static NBTs)

Primitive-Human commented 2 months ago

Admire the quick response.

I'm stuck between wondering if I want to have use case a or b myself due to balancing reasons. I am currently designing an immersive (GUI-less) magic modpack and mods like IF and their machines don't fit into that.

While Animus (Blood Magic 2 addon) does add a ritual for enchantment extraction, it also dupes level 1 enchanted books, so I want to ditch that.

I do have a working CT script that allows me to extract all enchants (use case a) from a list of permitted tools onto books, but that's a purely manual process.

I'll think about it some more whether I should want enchantment extraction to be automatable after all.