diff --git a/core/src/main/java/org/geysermc/geyser/item/type/ShulkerBoxItem.java b/core/src/main/java/org/geysermc/geyser/item/type/ShulkerBoxItem.java index 507174a55f..b470ef0713 100644 --- a/core/src/main/java/org/geysermc/geyser/item/type/ShulkerBoxItem.java +++ b/core/src/main/java/org/geysermc/geyser/item/type/ShulkerBoxItem.java @@ -101,6 +101,7 @@ public void translateComponentsToBedrock(@NonNull GeyserSession session, @NonNul if (boxComponents != null) { String customName = ItemTranslator.getCustomName(session, boxComponents, boxMapping, '7', false, true); if (customName != null) { + // Fix count display (e.g., x16) with incorrect color due to some items with colored names if (customName.contains("" + ChatColor.ESCAPE)) customName += ChatColor.RESET + ChatColor.GRAY; boxItemNbt.putCompound("tag", NbtMap.builder() .putCompound("display", NbtMap.builder() diff --git a/core/src/main/java/org/geysermc/geyser/translator/item/ItemTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/item/ItemTranslator.java index 058cc9b04a..9c66fcabac 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/item/ItemTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/item/ItemTranslator.java @@ -382,6 +382,7 @@ public static String getPotionEffectInfo(PotionContents contents, String languag .color((negativeEffectList.contains(effect)) ? NamedTextColor.RED : NamedTextColor.BLUE) .append(appendTranslatable) .build(); + // Bedrock supports wrap lines with '\n' in a single string in custom name finalText.append('\n').append(MessageTranslator.convertMessage(component, language)); } return finalText.toString(); @@ -544,6 +545,7 @@ public static String getCustomName(GeyserSession session, DataComponents compone if (potionName != null) return ChatColor.RESET + ChatColor.ESCAPE + translationColor + potionName; } if (includeAll) { + // Fix book title display in tooltips of shulker box WrittenBookContent bookContent = components.get(DataComponentType.WRITTEN_BOOK_CONTENT); if (bookContent != null) { return ChatColor.RESET + ChatColor.ESCAPE + translationColor + bookContent.getTitle().getRaw();