#NBT Entity Lore selector

1 messages · Page 1 of 1 (latest)

granite notch
#

/execute at @e[name="end_game:altar"] as @e[distance=..1,nbt={Item:{id:"minecraft:netherite_helmet"}},limit=1,nbt=!{tag:{display:{Lore:["{\"text\":\"« End Game »\"}"]}}}] run say yes

Hello, I tried to add several nbt in my selector but my command does not seem to work is it good? The game tells me that it works but I have no result

uneven lilyBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

                        🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you


                        
                        ✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
wintry glacier
#

Not that smartest cookie here, but maybe said item you are trying to select has different nbt then what you are specifically looking for

digital meadow
#

What command are you using to get the item you are testing for?

granite notch
#

I would like the entity I am testing from the endgame:altar controller to be a helmet but that it is not already the End Game lore

#

The command I run next is a tag but in my test it's just a say

granite notch
wintry glacier
wintry glacier
granite notch
#

I simplified the command and update it with 1.20+ components but it not working again
/execute at @s as @e[nbt={components:{"minecraft:lore":["{\"text\":\"« End Game »\"}"]}}] run say yes

digital meadow
#

That's wrong now. There is still an Item nbt value, which contains components

granite notch
#

Something like that is correct too but it doesn't work /execute at @s as @e[nbt={Item:{components:{"minecraft:lore":["{\"text\":\"« End Game »\"}"]}}}] run say yes

#

Nothing append

wintry glacier
#

The item you are testing for probably doesn't have the same NBT

#

at least check

digital meadow
#

Yeah, can you send us the command that you used to get the item?

granite notch
#

The item entity data

#

output : [System] [CHAT] Netherite Helmet has the following entity data: {Motion: [-8.775343891613977E-24d, -0.04d, 5.772200554260407E-25d], Owner: [I; 1752457915, 655248383, -1631140396, -425329622], Health: 5s, Invulnerable: 0b, Air: 300s, OnGround: 1b, PortalCooldown: 0, Rotation: [199.82043f, 0.0f], Thrower: [I; 1752457915, 655248383, -1631140396, -425329622], FallDistance: 0.0f, Item: {components: {"minecraft:lore": ['""', '{"color":"gold","italic":false,"text":"Récompense de quête :"}', '"« End Game »"'], "minecraft:unbreakable": {}}, count: 1, id: "minecraft:netherite_helmet"}, Pos: [-29.738951813453355d, 102.0d, -327.7932938484437d], PickupDelay: 0s, Fire: -1s, UUID: [I; -72168407, 1963214341, -1096542448, 1545526542], Age: 368s}

#

I ran a item modifier to do

digital meadow
#

I'll take a look later

outer cedar
#

If your item is a custom item, I would suggest using something to identify it with ease in the custom_data component

granite notch
granite notch
#

I made this command for you :

The Item :
/summon minecraft:item ~ ~2 ~ {Item:{id:"minecraft:netherite_helmet",count:1,components:{"minecraft:lore":['{text:""}',"{text:\"« End Game »\"}"]}}}

The test command :
/execute at @s as @e[nbt={Item:{id:"minecraft:netherite_helmet",components:{"minecraft:lore":['{text:""}',"{text:\"« End Game »\"}"]}}}] run say yes

digital meadow
#

You have an error in your JSON, which will cause it to break.

#

text: needs to be "text":

granite notch
#

NBT Lore selector

#

NBT Entity Lore selector

#

/summon minecraft:item ~ ~2 ~ {Item:{id:"minecraft:netherite_helmet",count:1,components:{"minecraft:lore":["{\"text\":\"\"}","{\"text\":\"« End Game »\"}"]}}}
/execute at @s as @e[nbt={Item:{components:{"minecraft:lore":["{\"text\":\"\"}","{\"text\":\"« End Game »\"}"]}}}] run say yes same, nothing detected

#

It worked better before 1.20 😅
1.20.5 24w09a Unstructured NBT data attached to stacks of items (tag field) has been replaced with structured 'components'.

uneven lilyBOT
# uneven lily <@&1201956957406109788>

<@&935561184806060073> <@&1202694677766348840>

**🙇 Helpers Arise!**

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

digital meadow
#

I'm not sure why this isn't working, but you should probaby just use custom data to detect the item

#

That will be much more reliable

royal tendon
#

afaik minecraft optimizes json text when saving/loading, so {"text":"Something"} simply becomes "Something", so hard checking for one or the other is sure to break