[1.21] Replacing textures on an item with multiple enchantments
Waitner98 opened this issue ยท 6 comments
The question
I have a problem. I want to replace the texture of an item that has several enchantments at once. With one enchantment everything works, but with two enchantments the texture of only one enchantment is displayed.
Here is the code:
type=item
items=brush
texture=optifine/cit/brush/un_me.png
enchantmentIDs=minecraft:mending minecraft:unbreaking
And the test file:
Test.zip
Checklist
- I checked the issues(both open and closed) and could not find a duplicate of my question
You need to use weight so that the texture with both enchantments takes priority over the textures with only 1 enchantment!
enchantmentIDs
is made to specify that this texture should be applied in case there is one of those enchantments, not all of them. Use components intead of this alias:
components.enchantments.levels.~unbreaking=regex:.*
components.enchantments.levels.~mending=regex:.*
regex:.*
is for any value (regular expression) , which basicaly means that this enchantment should exist in item's components, u can set it to some special level value if u need. I thought *
would do that, but after testing it seems not to, mb optifine docs (cit, syntax) have something better.
(u may set mending to 1 as there likely wont be another level but i would not)
@Waitner98 Are you sure you are using the latest version of cit resewn? It's 1.2.2. I know enchantments do not work on 1.2.0
@HiWord9
Unfortunately, nothing still works for me
@HiWord9 Yes, I have 1.2.2
@HiWord9
I figured out why it doesn't work. In fact, everything works, but for some reason when I have two enchantments (unbreaking and mending), the me.png texture is loaded on top of unme.png.
How can I now make it so that it doesn't use other textures if there is more than one enchantment?