Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Hover event text does not support translatable components

Open viveleroi opened this issue 7 months ago • 2 comments

Expected behavior

Hover events do not appear to support translatable components.

// text.foo = "foo"
Component.translatable("text.foo")
  .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
    Component.translatable("text.foo")))

The translation was registered with the store:

final var store = MiniMessageTranslationStore.create(Key.key("mynamespace:mykey"));
store.register("text.foo", "foo");
GlobalTranslator.translator().addSource(store);

Paper 1.21.5

Observed/Actual behavior

The code produces "foo" when sent to a player, but "text.foo" when hovered.

Steps/models to reproduce

Use the code above.

Plugin and Datapack List

? Server Plugins (4): Bukkit Plugins:

  • LuckPerms, NBTAPI, prism, WorldEdit

There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]

Paper version

1.21.5-76-main@04ffca0 (2025-05-09T15:38:33Z) (Implementing API version 1.21.5-R0.1-SNAPSHOT)

Other

No response

viveleroi avatar May 10 '25 14:05 viveleroi

If the same issue is present when you run the component through the translator manually you should open this issue on Adventure.

kezz avatar May 20 '25 18:05 kezz

I don't follow. How would I do this manually? It's specifically in the hover event that this fails.

viveleroi avatar May 25 '25 22:05 viveleroi

Unable to reproduce on 1.21.10

Image

Warriorrrr avatar Oct 11 '25 00:10 Warriorrrr