If I want multiple requirements for an item's texture to be replaced, what should I do on the nbt.display string?
For example, I want to create rules to replace the texture only when the name of the item (nbt.display.Name=...) and any lore string that includes a specific line of words (nbt.display.Lore.*=...), how do I combine them, or should they be placed in different lines?
#NBT based rule/tag
108 messages · Page 1 of 1 (latest)
separate line iirc
but in that case you should be able to detect a much direct nbt tag rather than combination of name and lore.
im currently making a unofficial resource pack for a server
so the nbt tags are limited if you know what i mean
scuffed
right now its like
type=item
items=minecraft:shears
damage=16 (the server uses damage to give items different models)
model=item/[model file name]
this line is where i put the bunch of nbt.display stuff in
you sure the server give unique item based on damage value not something else?
yep
but at the same time it also give unique name and lore to the item?
check the nbt of the item if you can
soo uh
an item has custom name and lore (with different colors if that matters)
and then the server resource pack gives models to the items by matching damage values on the item
thats pretty much what i know
tbh i have no clue where to check the nbt of the item
likely not
yep i cant do it
but i could try this
b u t i dont know any mods functioning like that
found a fabric one
https://www.curseforge.com/minecraft/mc-mods/nbt-viewer-fabric
but still what im working with is slightly more complicated
i already has a model working for the item
but when the item is used to cast a spell the item's name gets changed to the respective spell's name
and i want to make a model and a .properties for each spell cast
which is pretty much why i want to do what i said in the post (nbt.display.Name for matching spell naems and nbt.display.Lore.* for the item's lore that remains unchanged when casting a spell)
im going to record a video to try and demonstrate how it works
that also might have a nbt tag controlling it, but the very old traditional way, yes name and lore can do the check.
i suggest check the item's nbt first
what is the name(not cast) of this item again?
sorry to wasted your time, this plugin item is so inconsistent, checking item lore is the only way to ensure the same item.(assume at least part of the lores doesn't change)
huh
what does the damage=16 do? other than that should work for each different cast
i think even when a spell is cast the damage on the item stays
but since its optional im going to remove it and test a bit
still doesnt work
type=item
items=minecraft:shears
model=item/nirvana_dash
nbt.display.Name=regex:.*Dash spell cast.*
nbt.display.Lore.*=regex:.*Spiritual enlightenment.*
is it possible that the base model can override the 'spell cast' models
wdym?
i made 1 model for each respective spell that can be cast on the weapon and 1 for idle
the .properties file of the idle model (which i called the base model) is attached onto this message
i want to know whether this can override this .properties and apply the base model onto the item
does the code work? that's very creative
so the server already have this, and you are looking to apply your custom model when a specific spell is casted?
have what?
the .properties?
yes
oh nah its in my resource pack actually
so i can change it however i want, it already overrode the server's model
oh alr, you will need individual properties for each different spell cast.
yeah i do
each properties should check something unique
actually
but if somehow multiple properties pass the check
the one with higher weight will be use
and where does the 'weight' come from?
default is 0, you can add the line in your prpoerties
any line will do?
a new line
oh alright
the nbt just doesnt seem to be working
thanks for your help and sorry for wasting your time, i'll probably go try and contact the content team of the server to have a look at the nbt data of the item
if they even want to respond that is
feel free to let me know if you need anymore help
my only complain is that a custom id isn't recorded in the item.
if youre still here i figured a way to make the spell cast models work
the weight=1 on the ...multihit.properties is just for testing
but there is some really scuffed stuff i cant really work around with
basically when spell cast models' .properties' weight>0, it overrides the base model
but if all models' .properties' weight=0 (or all are equal), base model overrides all models
it just seems like that the base model is always the top priority if i dont modify the weight
Default weight is 0.
If multiple properties pass, will pick one based on file name.
then ill have to modify the .properties again
seems like they all pass
cuz you are using ( | ) which will pass when either side is true
so if one of them fits it'll just pass and use the model?
right, that's what the | or operator do
=regex:(?=.*Multi Hit spell cast.*)(?=.*Spiritual enlightenment.*)
i am new to all this but try ^
sorry but im almost completely new to this
still does this line (after nbt.display) mean
any line (name/lore) with either the string 'Multi Hit spell cast' or 'Spiritual enlightenment' pass?
im even newer ngl
if this doesn't work, you might have to just do a simple ordered check, =regex:.*some text that comes earlier.*some text that comes later.*
i kind of need an explanation on what the ?= means lol
yeah i need an explanation
can also test it here, tho probably not all regex support in optifine afaik
https://regex101.com/
oh ?= doesn't consume
without that, only the first one in the test string pass
this is giving me even more confusion
if i want both rules to pass at the same time in order to use the model, what should i change?
remove the |?
try this
or this
i just want to ask what does the * in 'nbt.display.*' do
is it a replacement for stuff like Lore and Name (for example nbt.display.Lore into nbt.display.*)
where the hell did the italic come from
ok there
the * in nbt.display.* stand for any index
mean if any index under display
when the path is much specific, it will become what's more well known, for example
nbt.display.Name
nbt.display.Lore.*(any line in lore)
nbt.display.Lore.0(1st line in lore)
nbt.display.Lore.-1(last line in lore)
however the screenshots you post earlier, the one with different cast, it does seem that they don't store item id in the item.
so you really do end up having to check either or both name and lore
try fill up all the content so i can check