Minecraft – way to Edit a specifics word in a Tell Raw Command

minecraft-commandsminecraft-java-edition

Right now im working on a map in Minecraft called "Fruit Parkour Course", and Right now im in a sticky situation. In the Story of the map, I Decided to use TellRaw command in order to make the characters Dialog.

For an Example :
/tellraw @a {text:"[Villager1] Hai"}

Now im curius to see, Is there a way to make a Specific Word to edit. Like, the villager say "Hello There !", and then i wanted to make the "Hello" word to be Italic. If somebody can help me about this, please tell me how to do it .

Best Answer

You can make a JSON-formatted string italicized by adding "italic":true to the tag. In order to have only part of the text be italic, you have to build your string from parts. You do this by putting multiple JSON tags ({ }) into a list ([ ]):

/tellraw @p [{"text":"Hello","italic":true},{"text":" there","italic":false}]

Note that italic is set to false in the second one. Unless you tell the JSON to change something about the formatting, it carries over to the next part. Just like the following will have all the text in blue, rather than just the first word, even though "color" is only set in the first tag:

/tellraw @p [{"text":"Hello","italic":true,"color":"blue"},{"text":" there","italic":false}]