diff --git a/src/main/java/io/github/steve4744/whatisthis/data/DataHandler.java b/src/main/java/io/github/steve4744/whatisthis/data/DataHandler.java index abff716..e8d7367 100644 --- a/src/main/java/io/github/steve4744/whatisthis/data/DataHandler.java +++ b/src/main/java/io/github/steve4744/whatisthis/data/DataHandler.java @@ -213,7 +213,11 @@ public String getEntityDisplayName(Entity entity, Player player) { } else if (entity.getType() == EntityType.ITEM_FRAME || entity.getType() == EntityType.GLOW_ITEM_FRAME) { final ItemFrame iframe = (ItemFrame) entity; if (plugin.getSettings().isItemFrameContentEnabled() && iframe.getItem().getType() != Material.AIR) { - targetName = translateItemName(iframe.getItem().getType().toString(), player); + if (iframe.getItem().getItemMeta() != null && iframe.getItem().getItemMeta().hasDisplayName()) { + targetName = iframe.getItem().getItemMeta().getDisplayName(); + } else { + targetName = translateItemName(iframe.getItem().getType().toString(), player); + } } }