-1

I'm trying to create a small basketball game on my server (from scratch to learn command blocks).

To test that it's working, I'm trying to have the Basketball item tell me who threw it. However, whenever I try this:

/execute @e[type=item,r=3] ~ ~ ~ /tell @p @s [{Thrower}]

it doesn't work.

Is it possible to have a NBT tag property in a tell command? Or is there something else I have to do?

I'm on version 1.12.2

0
0

Tell only lets you write simple text, if you want to give some more advanced information, you need to use tellraw with RawJSONText instead.
Including data inside the tellraw currently only works in Java Edition and there also only in 1.14 and above, as Bedrock doesn't give access to internal data structures and the data option of tellraw was added in 1.14.

So for example you can do

/execute as @e[type=item,distance=..3] run tellraw @a [{"nbt": "Thrower", "entity": "@s"}]

It will output the UUID of the player who threw the item in the form of an integer array.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.