Skip to content

Add helper methods for vanilla-style command feedback - #14331

Open
Strokkur424 wants to merge 19 commits into
PaperMC:mainfrom
Strokkur424:feat/command-feedback-helpers-2
Open

Strokkur424 wants to merge 19 commits into
PaperMC:mainfrom
Strokkur424:feat/command-feedback-helpers-2

Conversation

@Strokkur424

@Strokkur424 Strokkur424 commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Supersedes #13058
Closes #12579

Changes over the original PR by jmp:

  • Updated to latest commit on main
  • Renamed sendSystemMessage to sendReply
  • Updated the sendSuccess Javadoc to replace deprecated GameRule mentions with GameRules
  • Introduced sendRichReply, sendRichSuccess, and sendRichFailure overloads, which accept MiniMessage and TagResolvers

@Override
default void sendFailure(final ComponentLike message) {
Preconditions.checkNotNull(message, "message cannot be null.");
this.getHandle().sendFailure(PaperAdventure.asVanilla(message.asComponent()), false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well this comes from the base PR but not sure about ignore the default style used in vanilla, but its more a opinion... most of people who use this wanna custom messages so...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could theoretically just add an overload that does apply the style too. Maybe sendFailureStyled? Alternatively, could be a method parameter. Idk, whatever you think is best?

@Warriorrrr

Copy link
Copy Markdown
Member

didn't really give much time for jmp to look at your review there before opening your own PR there

I think sendSystemMessage would be a nicer name than sendReply or the old sendToTarget & the minimessage methods don't really seem necessary

@masmc05

masmc05 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

the minimessage methods don't really seem necessary

Minimessage methods are quite useful, including current ones on CommandSender, especially on just feedback as messages are often simple and defined in place in command handling

@Strokkur424

Copy link
Copy Markdown
Member Author

didn't really give much time for jmp to look at your review there before opening your own PR there

Just for your and anyone else's information, jmp did tell me I may open a PR to supersede his. I wouldn't have done it otherwise 😅

@Strokkur424

Copy link
Copy Markdown
Member Author

I think sendSystemMessage would be a nicer name than sendReply or the old sendToTarget & the minimessage methods don't really seem necessary

I can change it to sendSystemMessage again, sure, I thought maybe something shorter might be nice. Do you have any opinion on just calling it sendMessage directly, or is that too generic and may cause confusion between ctx.getSource().sendMessage() and ctx.getSource().getSender().sendMessage()?

The MiniMessage methods mirror the style of the ones on CommandSender, which I have found quite convenient. If you really think they should not be here, I can remove them again, but thought it might be a nice utility addition.

@Strokkur424
Strokkur424 requested a review from Doc94 October 3, 2026 20:04
Comment on lines +148 to +149
* <p>This currently includes checking for environments with suppressed output,
* {@link GameRules#SEND_COMMAND_FEEDBACK}, and {@link GameRules#LOG_ADMIN_COMMANDS}.</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can extend a little this? (where this is mentioned)

maybe can be to much info but the logic for admins and console... its like

  • Admins
    • The gamerule for command feedback
    • minecraft.admin.command_feedback permission (or op)
  • Console
    • The gamerule for log admin commands
    • The silentCommandBlocks when source its not a comand block

but maybe its to much info for this... and maybe can be just a mention in the docs rather than here (?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've spent some time thinking about how one could properly word this, and I have come to the evaluation that I think the current paragraph for this is already good enough. Generally, I think it's logical that command feedback is only sent for players with the relevant permission (the docs have that permission documented, albeit the description is outdated).

@Doc94

Doc94 commented Oct 5, 2026

Copy link
Copy Markdown
Member

didn't really give much time for jmp to look at your review there before opening your own PR there

I think sendSystemMessage would be a nicer name than sendReply or the old sendToTarget & the minimessage methods don't really seem necessary

not sure about the SystemMessage term in methods... all the use of that are internally and exposed with simple names like sendRawMessage, etc.

For the MM i feel dont hurt have... we already has sendRichMessage

@Strokkur424
Strokkur424 requested a review from Doc94 October 5, 2026 21:38
@Strokkur424
Strokkur424 requested a review from jpenilla October 5, 2026 22:31
Strokkur424 and others added 2 commits October 6, 2026 00:46
Co-authored-by: Pedro <3602279+Doc94@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Delayed approval

Development

Successfully merging this pull request may close these issues.

Paper/Minecraft Brigadier Command Feedback Parity

5 participants