Skip to content

keybind component

Andrey Vakhterov edited this page Feb 20, 2022 · 5 revisions

<keybind> A keybind identifier, to be displayed as the name of the button that is currently bound to that action.

properties

<text> can have the following properties (all optional)

property description value example
keybind (required) A keybind identifier see fandom wiki <keybind keybind="key.inventory" />
endl Add line-break (\n) in the end of component true, false <keybind keybind="key.chat" endl="true"/>
bold Whether to render the content in bold true, false <keybind keybind="key.chat" bold="true"/>
italic Whether to render the content in italics true, false <keybind keybind="key.chat" italic="true"/>
underlined Whether to underline the contents true, false <keybind keybind="key.chat" underlined="true"/>
strikethrough Whether to strikethrough the content true, false <keybind keybind="key.chat" strikethrough="true"/>
obfuscated Whether to render the content obfuscated true, false <keybind keybind="key.chat" obfuscated="true"/>
color The color to render the content in black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, white, reset, or 6-digit hexadecimal color format #<hex> <keybind keybind="key.chat" color="#FF0000"/>
font Text font. See fandom wiki minecraft:default,minecraft:alt <keybind keybind="key.chat" font="minecraft:alt"/>
insertion When the text is shift-clicked by a player, this string is inserted in their chat input. It does not overwrite any existing text the player was writing. This only works in chat messages. any text Click <keybind keybind="key.chat" insertion="chat"/> to open chat
onclick Allows for events to occur when the player clicks on text run:<command>, url:<url to open>, suggest:<command>, page:<page number>, copy:<text>, empty <keybind keybind="key.chat" onclick="run:I can not open the chat"/>

components

Tag content can includes:

component description
raw text Spaces and line breaks will collapse into a single space
<pre> Text which is to be presented exactly as written inside <pre>. No other tags allowed inside
<br/> Add a line break in text (carriage-return)
<space/> Add a space
<text> See text component
<keybind> See keybind component
<score> See score component
<keybind> See keybind component
<translatable> See translatable component
<selector> See selector component
<hover-text> Hover event. See hover-text tag
<hover-item> Hover event. See hover-item tag
<hover-entity> Hover event. See hover-entity tag

Only one hover event is allowed per content. Hover event can be placed only at the end of the content.

faq

What will be displayed? <keybind keybind="key.inventory" strikethrough="true"> text</keybind>?

E text


Clone this wiki locally