-
Bug
-
Resolution: Invalid
-
None
-
1.20.5 Release Candidate 2
-
None
-
win10, jdk 21.0.3
-
Unconfirmed
-
(Unassigned)
The lore of items has always used single and double quotation marks.
Use the following command to obtain a stick with lore:
/give @s stick[minecraft:lore=[' "text" ']] 1
But in "hoverEvent" of text components, in "show_item", the lore component can only use two layers of double quotes, and cannot use single quotes to wrap double quotes, otherwise it will get a malformed JSON error.
Use the following command to tellraw text carrying hoverEvent to all players, which can display a grass block with lore:
/tellraw @a [{"text":"[ITEM]","hoverEvent":{"action":"show_item","contents":{"id":"minecraft:grass_block","count":32,"components":{"minecraft:lore":[" \"text\" "]}}}}]
It works because we used two layers of double quotes.
But the following command will result in an error:
/tellraw @a [{"text":"[ITEM]","hoverEvent":{"action":"show_item","contents":{"id":"minecraft:grass_block","count":32,"components":{"minecraft:lore":[' "text" ']}}}}]