Skip to main content

Hover

Specifies what to display once the enclosed content has been hovered over.

Show Text

Overview

Displays a single line of text when hovering.

<hover-text

  valuemarkup

  ↪ Content to display when hovering

>markup</>

Example

Code-Blocks are only available within the browser

Show Item

Overview

Displays the tooltip of an item when hovering.

<hover-item

  materialstring(null)

  ↪ Namespaced-key of the item's material

  ↪ E.g. minecraft:dirt

  amountnumber(null)

  ↪ Size of the stack

  namemarkup(null)

  ↪ Name-content of the item

  loremarkup(null)

  ↪ Lore-content of the item

  hide-propertiesboolean(false)

  ↪ Whether to hide all vanilla properties

>markup</>

Examples

The following sections will demonstrate common applications of this hover-type.

Multiline Text

Since Code-Blocks are only available within the browser only supports single-line tooltips due to inherent limitations on the client, as soon as multiline tooltips are to be displayed, Code-Blocks are only available within the browser becomes a viable alternative; note that there is a bit more spacing in-between the item-name and the first lore-line than is between subsequent lore-lines, which is why this special markup-slot would make for a great headline, as to not break uniformity.

Code-Blocks are only available within the browser

Mimicking Items

The main intent of this hover-type is to display tooltips of items with arbitrary complexity, meaning not just custom name and lore-lines, but also enchantments, attributes, effects, and so on and so forth; these do not take any actual effect, but end up as mere visual signals.

While it has been the norm up to this point to specify said special properties as a raw NBT-value, we would like to propose a simplification: employ the Code-Blocks are only available within the browser-tag in order to render language-agnostic names and then just incrementally build out the the item's visual representation - always enable the Code-Blocks are only available within the browser flag, as to ensure that any vanilla-details like attack-damage and the like do not end up disturbing the final result.

This new approach significantly reduces complexity, as only translation-keys must be known, instead of the full NBT-structure, which undergoes so many regular changes; resolving them from bukkit-constants across all versions could be neatly packaged up into a little library.

Let's take the following real item as a template:

Then, the following markup, which could easily become data-driven, will perfectly represent its real tooltip:

Code-Blocks are only available within the browser

Show Entity

Overview

Displays a tooltip containing information about an entity within the player's world; note that this only works when advanced tooltips are shown (F3+H); also note that the entity-ID has to exist for the tooltip to render at all; the name may be specified as any arbitrary content.

<hover-entity

  typestring

  ↪ Namespaced-key of the entity's type

  ↪ E.g. minecraft:sheep

  idstring

  ↪ The UUIDv4 of the entity

  namemarkup(null)

  ↪ Custom name of the entity

>markup</>

Examples

Code-Blocks are only available within the browser