#Get component value from player.cursor

1 messages · Page 1 of 1 (latest)

normal geyserBOT
#

Hello!

I want to know if exist any way to get a componente value from the item in the player.cursor, like the repair_cost.

I tried this:

/execute store result score @s my_score if items entity @s player.cursor *[minecraft:repair_cost]

but obviously it wasn't going to work, but I think that command makes it easier to understand what I'm talking about.
Thanks for reading!

slender rootBOT
#

<@&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:1747684430: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

brisk crypt
shadow viper
#

Can't you just /item replace the item from player.cursor into any chest and then access it's NBT (or otherwise do what you want with it)

thick prism
#

what's player.cursor? 💀 never seen it

brisk crypt
shadow viper
#

I don’t see an issue

shadow viper
brisk crypt
#

you're right about the item replace command, but instead of a chest, there's a yellow shulker box in the custom/overworld dimension.

shadow viper
#

That’s kinda unnecessary. Just use the position of the player which is almost certainly going to be air anyway, or y=-64, which is almost certainly going to be bedrock

summer yoke
#

in this case it's easier to just use an item display. yellow shulker box is broadly outdated anyway

topaz ginkgo
#

I solved it as recommended by @shadow viper , it works perfectly!

shadow viper
#

Looks good :)

slender rootBOT
#
Question Closed

Your question, #1374105285995794504 (Get component value from player.cursor), was resolved!

Original Message

#1374105285995794504 message

Duration open

52m

shadow viper
#

you just opened the thread again :p

slender rootBOT
#
Question Closed

Your question, #1374105285995794504 (Get component value from player.cursor), was resolved!

Original Message

#1374105285995794504 message

Duration open

58m