i am not sure if there is a sponge plugin yet for this, but i would like the> “you do not have permission to use this command”
and “Unknown command. Try /help for a list of commands”
so that they can be changed and support colors.
i am not sure if there is a sponge plugin yet for this, but i would like the> “you do not have permission to use this command”
and “Unknown command. Try /help for a list of commands”
so that they can be changed and support colors.
As far as I know, there’s not an easy way to change that at the moment.
All of the command messages are handled internally by Sponge and, as far as I can tell, are unmodifiable. There might be a way to override the default Sponge command manager but I am not sure of a way to do that.
This is how I do it:
On the sendcommandevent, if the command does not exist, cancel the event and the unknown command message won’t be send.
Code (from my UltimateCore plugin, which is not released yet)
im not a coder but from what i have been told so far that this is what tosses the message
https://jd.spongepowered.org/5.0.0/org/spongepowered/api/command/CommandPermissionException.html
located in the api here
i was also told It could be possible by somehow overriding the checkPermission method
The problem with using the Exception is that you cannot guarantee being able to change every message, as plugins will provide their own exceptions for their own reasons. What Bammerbum did will work for the unknown command message, however permissions denied messages are spread out and much harder to narrow down. The messages are sent to the player in the SpongeCommandManager, found here: https://github.com/SpongePowered/SpongeCommon/blob/bleeding/src/main/java/org/spongepowered/common/command/SpongeCommandManager.java#L303
As far as I can tell, there is no way to change this without replacing the command manger.