#How to change nbt?

1 messages · Page 1 of 1 (latest)

rocky leaf
#

I want to set custom nbt for item in chest minecart (container.0) from scoreboard but i dont know how?

tranquil ploverBOT
#

<@&1201956957406109788>

Someone will come and help soon!

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

🙇 If nobody has answered you by <t:1723395154:t>, feel free to use the Summon Helpers button to ping our helper team.

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

vital spire
#

/data command lets you manipulate nbt data however you want

uneven terrace
vital spire
#

i am not sure what do you mean exactly when saying "from scoreboard" can you elaborate on that

vital spire
outer otter
#

maybeee they mean a dictionary

vital spire
#

how do you set nbt from scoreboard, what that means? just execute store?

outer otter
#

1 = sword
2 = stone

#

idk

vital spire
snow furnaceBOT
#

you can use ```ansi
execute store result entity @n[type=minecart] path run scoreboard players get @s objective

uneven terrace
outer otter
#

but

#

they cant

#

only markers have data for that

vital spire
#

huhhh?

outer otter
#

yeah but not custom data

#

and idk where you would include your value

#

unless they store it in an item

uneven terrace
#

they can store like the count of an item

vital spire
#

why is the op not here

uneven terrace
#

or the data of the item

#

there are many usecases in which you want to modify the data of an item using scoreboards

rocky leaf
#

sorry i was afk

#

i meant that i have nbt ammo on item (ender_eye{ammo:30})

#

and i want to set this ammo to number from scoreboard (sorry for incorrect english)

uneven terrace
rocky leaf
#

when i have score 60 = ammo:60

uneven terrace
#

you do need to modify the path to have the actual correct path

#

what version are you in?

rocky leaf
#

1.20.4

uneven terrace
#

ah ok

#

then your command should be:

snow furnaceBOT
#
execute store result entity @n[type=minecart] Items[0].nbt.ammo run scoreboard players get @s ammo
rocky leaf
#

@n?

uneven terrace
#

oh sorry a newfeature in 1.21

#

got so used to it

#

replace it with @e[type=minecart,sort=nearest,limit=1]

rocky leaf
uneven terrace
#

ah yea use double

#

and then a 1 after that

#

for not scaling the score

uneven terrace
#

If you want to have more that 255 ammo, you can place int there instead

rocky leaf
#

ok, thanks

uneven terrace
#

using byte uses less data storage so it's more efficient for world lag and save file size

tranquil ploverBOT
# rocky leaf ok, thanks
🎗️ Is your question resolved?

If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D

tranquil ploverBOT
# tranquil plover
Question Closed

Your question, #1272228676389568655 (How to change nbt?), was resolved!

Original Message

#1272228676389568655 message

Duration open

33m