diff --git a/Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java b/Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java index 92c0739818..dd0e7f65be 100644 --- a/Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java +++ b/Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java @@ -10,6 +10,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.tags.TagKey; @@ -84,9 +85,11 @@ public static Component getEdition() { public static Component getTitle(ItemStack stack) { Component title = stack.getHoverName(); + // Akashic tome tag contains a `text` field, which is a stringified text component String akashicTomeNBT = "akashictome:displayName"; if (stack.hasTag() && stack.getTag().contains(akashicTomeNBT)) { - title = Component.Serializer.fromJson(stack.getTag().getString(akashicTomeNBT)); + CompoundTag nameTextComponent = stack.getTag().getCompound(akashicTomeNBT); + title = Component.Serializer.fromJson(nameTextComponent.getString("text")); } return title;