Firstly i just want to say that i'm really not familiar with the hoverEvent JSON component, so please excuse me if the solution of my problem is really simple (even if i don't think so).
Here's my problem :
Is there a way to make an hoverEvent that shows an item from an block's or entity's nbt ? I mean. When you die from a mob using a custom item, this item's name is shown in the chat log and this text is an hoverEvent to the complete description of this item. Is there a way to reproduce this ? And i mean : to reproduce this in Vanilla Minecraft, using only commands or "normal" datapacks like functions.
I've thought to use the /execute if block x y z id{nbt} but i'd need at least 33 of these commands to make it work (because this block contain 1 random item from a list of 33 custom items using loot table). I want to show this item's nbt to the player(s), and i've found a solution but this is really tedious and not even nice to see.
Sorry if my english isn't perfect, i hope i'm understandable. Thanks you to read and/or help me.
Something like "/tellraw @p {"nbt":"SelectedItem","entity":"@p","interpret":"true"}"
Just put this as a hoverEvent
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
/tellraw @p {"nbt":"Items[0].tag.display.Lore[0]","block":"545 6 763","interpret":true} works as intended so it gives me the 1st Lore of the Item,
but
/tellraw @a {"text":"Your Item","hoverEvent":{"action":"show_text","value":{"nbt":"Items[0].tag.display.Lore[0]","block":"545 6 763","interpret":true}}} works, but displays nothing (the attachments image).
It's a json tag inside another json tag, you have to add slashes for allowing the game seeing what belongs to first tag and to second one.
Well I guess...
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
But obviously this command, even if it works, doesn't give the result i expect at all. It just shows the whole {\"nbt\":\"Items[0].tag.display.Lore[0]\",\"block\":\"545 6 763\",\"interpret\":\"true\"} when you hover Your Item.
I dont think what i want is doable for 1.14.3, the nbt JSON component is kinda broken to be honest. nbt JSON component in JSON just doesn't work, i think. At least, for the few tries i made, it's the result i've.
Hi all,
Firstly i just want to say that i'm really not familiar with the hoverEvent JSON component, so please excuse me if the solution of my problem is really simple (even if i don't think so).
Here's my problem :
Is there a way to make an hoverEvent that shows an item from an block's or entity's nbt ? I mean. When you die from a mob using a custom item, this item's name is shown in the chat log and this text is an hoverEvent to the complete description of this item. Is there a way to reproduce this ? And i mean : to reproduce this in Vanilla Minecraft, using only commands or "normal" datapacks like functions.
I've thought to use the /execute if block x y z id{nbt} but i'd need at least 33 of these commands to make it work (because this block contain 1 random item from a list of 33 custom items using loot table). I want to show this item's nbt to the player(s), and i've found a solution but this is really tedious and not even nice to see.
Sorry if my english isn't perfect, i hope i'm understandable. Thanks you to read and/or help me.
Have a good day,
Lunisole
https://www.google.com/url?sa=t&source=web&rct=j&url=https://m.youtube.com/watch?v=xo-ksI9V6Yk&ved=2ahUKEwjFz4zqkLjjAhUsTt8KHR-pAQcQwqsBMAB6BAgBEAU&usg=AOvVaw1MLAAtF-IZGEfxRsx3_Jv3
This could be what you're searching for...
Something like "/tellraw @p {"nbt":"SelectedItem","entity":"@p","interpret":"true"}"
Just put this as a hoverEvent
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Actually tried :
/tellraw @p {"nbt":"Items[0].tag.display.Lore[0]","block":"545 6 763","interpret":true} works as intended so it gives me the 1st Lore of the Item,
but
/tellraw @a {"text":"Your Item","hoverEvent":{"action":"show_text","value":{"nbt":"Items[0].tag.display.Lore[0]","block":"545 6 763","interpret":true}}} works, but displays nothing (the attachments image).
Am i having the wrong synthax or ?
Try this :
/tellraw @a {"text":"Your Item","hoverEvent":{"action":"show_text","value":{/"nbt/":/"Items[0].tag.display.Lore[0]/",/"block/":/"545 6 763/",/"interpret/":/"true/"}}}
It's a json tag inside another json tag, you have to add slashes for allowing the game seeing what belongs to first tag and to second one.
Well I guess...
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Nope, it's just another occurence of this bug : https://bugs.mojang.com/browse/MC-146598 i think.
slashes are used only to skip quotations marks when you're already in quotation, for example in this case :
/tellraw @a {"text":"Your Item","hoverEvent":{"action":"show_text","value":"{\"nbt\":\"Items[0].tag.display.Lore[0]\",\"block\":\"545 6 763\",\"interpret\":\"true\"}"}}
But obviously this command, even if it works, doesn't give the result i expect at all. It just shows the whole {\"nbt\":\"Items[0].tag.display.Lore[0]\",\"block\":\"545 6 763\",\"interpret\":\"true\"} when you hover Your Item.
I dont think what i want is doable for 1.14.3, the nbt JSON component is kinda broken to be honest. nbt JSON component in JSON just doesn't work, i think. At least, for the few tries i made, it's the result i've.