[MC-56373] New tellraw features not working on hover event Created: 05/Jun/14  Updated: 27/Apr/18

Status: Reopened
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 14w21b, Minecraft 14w26b, Minecraft 14w29b, Minecraft 14w30a, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w44b, Minecraft 16w06a, Minecraft 1.9 Pre-Release 3, Minecraft 1.9, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w43a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 18w16a
Fix Version/s: None

Type: Bug
Reporter: Maxwell Souza Carvalho Assignee: Unassigned
Resolution: Unresolved Votes: 23
Labels: None

Win 8.1 java 64 bits updated

Attachments: PNG File 2014-06-05_13.58.33.png     PNG File 2014-06-05_13.59.34.png     PNG File 2014-06-05_14.00.35.png    
Issue Links:
is duplicated by MC-62448 Tellraw Hover event settings while us... Resolved
is duplicated by MC-73995 Bug with /tellraw hoverEvent command Resolved
is duplicated by MC-76246 Show Entity Hover Event Not Functioning Resolved
Confirmation Status: Confirmed


Some tellraw features like player score and selectors didn't work in hover event. examples:
1- if i use the command

/tellraw @a {"text":"Hover Player Selector","hoverEvent":{"action":"show_text","value":[{"text":"Player is ","color":"dark_red"},{"selector":"@p"}]}}

will show the first screenshot

2- if i use the command

/tellraw @a {"text":"Hover score","hoverEvent":{"action":"show_text","value":[{"text":"score is ","color":"dark_red"},{"score":{"name":"test","objective":"vars"}}]}}

will work correctly like the second screenshot;

but if i try to show the own player score using the command

/tellraw @a {"text":"Hover Player score","hoverEvent":{"action":"show_text","value":[{"text":"score is ","color":"dark_red"},{"score":{"name":"*","objective":"vars"}}]}}

will happens what is in the 3rd screenshot

Code analysis by [Helper] Marcono1234 can be found in this comment.

Comment by [Helper] Marcono1234 [ 10/Jun/14 ]

Partswise confirmed for 14w21b:

  • 1. Command isn't working
  • 2. Command isn't working with "test" (my name isn't test), BUT also not working with SELECTORS where else this is working:
    /tellraw @a {score:{name:@p,objective:vars}}
  • 3.Command isn't working like you said, but maybe intended
Comment by Maxwell Souza Carvalho [ 10/Jun/14 ]

the 2 command, if you instead use a selector, use a name, like Marcono1234 will work

Comment by [Mod] Skylinerw [ 25/Jun/14 ]

Confirmed for 14w26b. As a shorter example:

/tellraw @a {text:"Hover",hoverEvent:{action:show_text,value:{selector:@p}}}

The above should show my name upon hovering over "Hover", but instead shows "@p". And just an example showing "selector" at work, which simply displays my name in chat:

/tellraw @a {selector:@p}
Comment by [Mod] Skylinerw [ 23/Jul/14 ]

Confirmed for 14w30a.

Comment by [Mod] Odysseius [ 20/Dec/14 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.

Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been delivered.

Comment by Kavukamari [ 08/Jan/15 ]

Confirmed for 1.8.2-pre1

Comment by Tan Chin Cheern [ 08/Jan/15 ]

Did you try 'minecraftjson.com' as a tellraw generator by Ezekielelin?

Comment by Maxwell Souza Carvalho [ 09/Jan/15 ]

i use a lot the Ezekielelin generator, but it don't use all the features of tellraw yet, like scoreboards and selectors on hover event.
json is very complex and have a lot of features, Ezekielelin don't use all of them

Comment by [Mod] Skylinerw [ 13/Feb/15 ]

Confirmed up to 1.8.2 pre-6.

Comment by [Helper] Marcono1234 [ 28/Jul/15 ]

Confirmed for

  • 1.8.8 The behaviour is pretty interesting, it is the same like for resolved books with a selector tag in the pages tag.
selector: Not working
/tellraw @p {"text":"Hover","hoverEvent":{"action":"show_text","value":{"selector":"@p"}}}
translate: Working
/tellraw @p {"text":"Hover","hoverEvent":{"action":"show_text","value":{"translate":"Number: %s","with":[1]}}}
score: Working for explicit player names
/tellraw @p {"text":"Hover","hoverEvent":{"action":"show_text","value":{"score":{"name":"Notch","objective":"test"}}}}
Comment by [Mod] Skylinerw [ 14/Feb/16 ]

Confirmed for 16w06a, though it seems that explicit player names for scores do not work anymore.

Comment by [Helper] Marcono1234 [ 15/Feb/16 ]

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.
The method probably have changed as the experienced behaviour changed as well.

The reason for this is that the public static IChatComponent func_179985_a(ICommandSender p_179985_0_, IChatComponent p_179985_1_, Entity p_179985_2_) throws CommandException method of the net.minecraft.util.ChatComponentProcessor class which transforms chat components, for example {"selector":"@p"} becomes {"text":"Notch"}, does not transform the chat components of hoverEvents. This is why once the hoverEvent is displayed it shows for example "@p". The reason why scores no longer work as well, might be because they changed the String getUnformattedTextForChat() for multiple chat components as they returned the evaluated value as well (this method and the other methods getting the text value probably only make sense for the net.minecraft.util.ChatComponentText class).

public static IChatComponent func_179985_a(ICommandSender p_179985_0_, IChatComponent p_179985_1_, Entity p_179985_2_) throws CommandException
    Object var3 = null;
    ChatStyle var9 = p_179985_1_.getChatStyle();

    if (var9 != null)
        // Changed this
        // Imported net.minecraft.event.HoverEvent
        ChatStyle chatStyleCopy = var9.createShallowCopy();
        HoverEvent hoverEvent = var9.getChatHoverEvent();
        if (hoverEvent != null && hoverEvent.getAction() == HoverEvent.Action.SHOW_TEXT) {
            chatStyleCopy.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, func_179985_a(p_179985_0_, hoverEvent.getValue(), p_179985_2_)));
        ((IChatComponent) var3).setChatStyle(chatStyleCopy);

    Iterator var11 = p_179985_1_.getSiblings().iterator();

    while (var11.hasNext())
        IChatComponent var13 = (IChatComponent)var11.next();
        ((IChatComponent)var3).appendSibling(func_179985_a(p_179985_0_, var13, p_179985_2_));

    return (IChatComponent)var3;
Comment by [Mod] Skylinerw [ 26/Feb/16 ]

Confirmed for 1.9 pre-3.

Comment by M [ 26/Feb/17 ]

Present in 1.11.2 and snapshot 17w06a
Still affects cases 1 and 3 mentioned in Marcono1234's comment from 28/Jul/15 . Translate feature works correctly, while displaying scores does not.

Comment by Alex³ [ 27/Apr/18 ]

still present in 18w16a

Generated at Thu Jun 21 16:56:02 CDT 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.