Skip to content

HoverEvent.ShowItem not working in 1.20.5+ #10670

@ShaneBeee

Description

@ShaneBeee

Expected behavior

I expect this method to work like on 1.20.4 where it would show all item modifications

Observed/Actual behavior

When using the hover event to show item, the vanilla/base item is shown, and no modifications are show (ex: enchantments, display name).
Screenshot 2024-05-06 at 9 32 07 AM

Steps/models to reproduce

Test Code:

ItemStack itemStack = new ItemStack(Material.DIAMOND);
itemStack.editMeta(itemMeta -> {
    itemMeta.displayName(Component.text("Mr Diamond"));
    itemMeta.addEnchant(Enchantment.SHARPNESS, 3, true);
});
TextComponent letsSeeThatItem = Component.text("lets see that item");
BinaryTagHolder binaryTagHolder = BinaryTagHolder.binaryTagHolder(itemStack.getItemMeta().getAsString());
HoverEvent.ShowItem showItem = HoverEvent.ShowItem.showItem(itemStack.getType().key(), 1, binaryTagHolder);
TextComponent textComponent = letsSeeThatItem.hoverEvent(HoverEvent.showItem(showItem));
sender.sendMessage(textComponent);

Plugin and Datapack List

[09:30:53 INFO]: Server Plugins (8):
[09:30:53 INFO]: Bukkit Plugins:
[09:30:53 INFO]:  - BeeConomy, RandomTeleport, SkBee, SkBriggy, Skript, skript-reflect, spark, Vault

Paper version

Paper version git-Paper-49 (MC: 1.20.6)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Invalid

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions