Tooltip: lore after the enchantments, as ItemStack.addDetailsToTooltip

Vanilla adds LORE after CONTAINER, BANNER_PATTERNS, FIREWORKS,
POTION_CONTENTS, TRIM and the enchantments, and before the attribute
modifiers, not right under the name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-25 17:30:37 +01:00
parent d9360338f6
commit 0609fb2beb
+7 -6
View File
@@ -1674,12 +1674,6 @@ impl Game<'_> {
if display.name_visible(self.screen == Screen::Creative) {
lines.push((horizon_client::text::Text::legacy(&name), color));
}
// ItemLore.addToTooltip: after the name, before other component lines.
if display.shows("minecraft:lore") {
for text in horizon_client::item_tooltip::lore_texts(stack) {
lines.push((text, u32::MAX));
}
}
let translate = |k: &str| e.translate(k).map(str::to_owned);
let push = |lines: &mut Vec<(horizon_client::text::Text, u32)>, s: String, c: u32| {
lines.push((horizon_client::text::Text::legacy(&s), c));
@@ -1776,6 +1770,13 @@ impl Game<'_> {
);
}
}
// ItemLore.addToTooltip: after the enchantments, before the attributes
// (ItemStack.addDetailsToTooltip).
if display.shows("minecraft:lore") {
for text in horizon_client::item_tooltip::lore_texts(stack) {
lines.push((text, u32::MAX));
}
}
// Spawner.appendHoverText: what a spawner or trial spawner item spawns.
if display.shows("minecraft:block_entity_data")
&& matches!(