#NBT based rule/tag

108 messages · Page 1 of 1 (latest)

subtle dawn
#

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?

stiff ledge
#

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.

subtle dawn
#

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

stiff ledge
#

you sure the server give unique item based on damage value not something else?

subtle dawn
#

yep

stiff ledge
#

but at the same time it also give unique name and lore to the item?

#

check the nbt of the item if you can

subtle dawn
#

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

stiff ledge
#

are you able to run a /data get command?

#

or via some nbt viewer client side(?) mod

subtle dawn
subtle dawn
stiff ledge
subtle dawn
#

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

stiff ledge
#

that also might have a nbt tag controlling it, but the very old traditional way, yes name and lore can do the check.

subtle dawn
stiff ledge
#

i suggest check the item's nbt first

subtle dawn
#

incredible bot moment

stiff ledge
#

what is the name(not cast) of this item again?

subtle dawn
#

Nirvana

#

would this work for when the weapon is casting the spell dash?

stiff ledge
#

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)

subtle dawn
#

huh

stiff ledge
#

what does the damage=16 do? other than that should work for each different cast

subtle dawn
#

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

stiff ledge
#
type=item
items=minecraft:shears
model=item/nirvana_dash
nbt.display.Name=regex:.*Dash spell cast.*
nbt.display.Lore.*=regex:.*Spiritual enlightenment.*
subtle dawn
#

is it possible that the base model can override the 'spell cast' models

stiff ledge
#

wdym?

subtle dawn
stiff ledge
#

does the code work? that's very creative

subtle dawn
#

it does
thats where the model in the video i sent come frmo

#

from*

stiff ledge
subtle dawn
#

have what?
the .properties?

stiff ledge
#

yes

subtle dawn
#

oh nah its in my resource pack actually
so i can change it however i want, it already overrode the server's model

stiff ledge
#

oh alr, you will need individual properties for each different spell cast.

subtle dawn
#

yeah i do

stiff ledge
#

each properties should check something unique

subtle dawn
#

actually

stiff ledge
#

but if somehow multiple properties pass the check

#

the one with higher weight will be use

subtle dawn
#

and where does the 'weight' come from?

stiff ledge
#

default is 0, you can add the line in your prpoerties

subtle dawn
#

any line will do?

stiff ledge
#

a new line

subtle dawn
#

alright

#

what's the ^M for?

stiff ledge
#

probably just github document marking

#

weight=1

subtle dawn
#

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

stiff ledge
#

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.

subtle dawn
#

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

subtle dawn
#

it just seems like that the base model is always the top priority if i dont modify the weight

stiff ledge
#

Default weight is 0.
If multiple properties pass, will pick one based on file name.

subtle dawn
#

then ill have to modify the .properties again
seems like they all pass

stiff ledge
#

cuz you are using ( | ) which will pass when either side is true

subtle dawn
#

so if one of them fits it'll just pass and use the model?

stiff ledge
#

right, that's what the | or operator do

#

=regex:(?=.*Multi Hit spell cast.*)(?=.*Spiritual enlightenment.*)
i am new to all this but try ^

subtle dawn
#

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

stiff ledge
subtle dawn
subtle dawn
#

yeah i need an explanation

stiff ledge
#

oh ?= doesn't consume

#

without that, only the first one in the test string pass

subtle dawn
#

this is giving me even more confusion

subtle dawn
subtle dawn
#

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

stiff ledge
#

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

subtle dawn
#

oh shoot

#

ignore the \s

stiff ledge
#

try fill up all the content so i can check

subtle dawn
#

oh my fucking god

#

wait

#

ilove being idiotic

#

so the system is going to check both rules and if they both pass the model will be applied onto the item?