5

I have a mob(sheep) with custom name is "ABC" here:Sheep

I have tried this command : data get entity <sheep> CustomName enter image description here

But i want to it return ABC only, not {"text":"ABC"}. I also tried something like data get entity <sheep> CustomName.text but it didn't work. Thanks for any helps!

1 Answer 1

2

At the risk of asking for clarification, I don’t think there is much need of converting the JSON into a user-friendly string, because Minecraft already does that for you.

If you copy the entire data over to a different location, like a book, sign, chat message, title, display name, or more, it will show up as “ABC”, because Minecraft will turn it into that.

It’s only in this form so that you can clearly view all the different components of a string (text, fonts, colors, bold, italic, hoverEvents or clickEvents in some cases), and even possibly edit them.

If you are trying to copy it over into a message and you are getting an output that says ‘{“text”:”ABC”}’, you can set the interpret setting to true, and the message will instead say “ABC”. In a command like this: /tellraw @p {"nbt":"CustomName","entity":"<sheep>","interpret":true}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .