Skip to content

MessageComponentSerializer doesn't apply tooltip when supplying async argument suggestions #12458

@erpixxx

Description

@erpixxx

Expected behavior

MessageComponentSerializer should return the given tooltip for the argument suggestion when supplied asynchronously.

Observed/Actual behavior

When supplying command suggestions asynchronously using CompletableFuture#supplyAsync, the suggestion's tooltip is empty.

Steps/models to reproduce

Commands.literal("chat")
        .then(Commands.literal("channel")
                .then(Commands.argument("channel_name", StringArgumentType.word())
                        .suggests((ctx, builder) -> CompletableFuture.supplyAsync(() -> {
                            builder.suggest("test", MessageComponentSerializer.message().serialize(
                                    // The tooltip will be empty
                                    MiniMessage.miniMessage().deserialize("<blue>test tooltip")
                            ));
                            return builder.build();
                        }))
                        .build())
                .build())
        .build();

Plugin and Datapack List

N/A

Paper version

This server is running Paper version 1.21.4-226-ver/1.21.4@a838a88 (2025-04-17T19:20:57Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

One way to work around this is by using Brigadier LiteralMessage, although it doesn't support Components.

While the Paper API documentation specifies that most of its API is not usable within asynchronous CompletableFuture calls, currently there’s no alternative way to provide Component tooltips in suggestions asynchronously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions