Skip to content

Cannot convert direct holder to bukkit representation (Goat horn without proper instrument assigned) #11911

@Athar42

Description

@Athar42

Expected behavior

Up to release 1.21.3, we were able to retrieve the PDC data of a custom goat horn which doesn't use a standard instrument (see below to reproduce).

Trying to retrieve the value using that code :
event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(myplugin, "customhorn")

should get me "filename.mp3" (where "event" is "PlayerInteractEvent")

Observed/Actual behavior

Now, doing the same code with 1.21.4 end with an error :
java.lang.IllegalArgumentException: Cannot convert direct holder to bukkit representation

Steps/models to reproduce

Give yourself a modified goat horn with a custom instrument (using a vanilla sound_event) + some custom_data (which will reflect the PDC creation) :

/give @a goat_horn[instrument={use_duration:10,range:100,sound_event:"minecraft:intentionally_empty"},custom_data={PublicBukkitValues:{"myplugin:customhorn":"filename.mp3"}]

If you try to retrieve the custom_data "myplugin:customhorn", you'll get the error.

Plugin and Datapack List

[03:07:15 INFO]: Server Plugins (6):
[03:07:15 INFO]: Bukkit Plugins:
[03:07:15 INFO]: - ArmorPoser, CustomDiscs, ProtocolLib, ViaBackwards, ViaVersion, voicechat

No Datapacks

Paper version

version
[03:07:53 INFO]: Checking version, please wait...
[03:07:53 INFO]: This server is running Paper version 1.21.4-75-main@9f90b4c (2025-01-04T21:02:23Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-72-daddcf6 (MC: 1.21.4)

Other

Behavior discussed on Discord + a PR which "resolve" it : #11910

I don't know what other informations would be needed, so if not clear enough, I'll edit it/reply with more content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.4Game version 1.21.4

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions