Class BungeeMessage
java.lang.Object
com.mrivanplays.ivancord.api.command.message.BungeeMessage
- All Implemented Interfaces:
com.mojang.brigadier.Message
Represents a BungeeCord implementation of the Brigadier's
Message
interface.
With it, you are able to send custom messages to the command senders, using
SuggestionsBuilder.suggest(String, Message)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TextComponent
convertContextOf
(com.mojang.brigadier.exceptions.CommandSyntaxException exception) ConvertsCommandSyntaxException.getContext()
to a component.static BaseComponent
convertSyntaxException
(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Converts the providedCommandSyntaxException
into a BungeeCord style message.static BungeeMessage
createOfTranslatable
(String id, ChatColor color, Object... with) A utility method to create aBungeeMessage
with a message ofTranslatableComponent
with the appropriate translationid
Returns the message provided.toString()
-
Constructor Details
-
BungeeMessage
Creates a newBungeeMessage
- Parameters:
text
- components
-
-
Method Details
-
createOfTranslatable
A utility method to create aBungeeMessage
with a message ofTranslatableComponent
with the appropriate translationid
- Parameters:
id
- the translation idwith
- theString
s andBaseComponent
s to use in the translation- Returns:
- new bungee message instance
-
convertSyntaxException
public static BaseComponent convertSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Converts the providedCommandSyntaxException
into a BungeeCord style message.- Parameters:
exception
- the exception provided- Returns:
- a message that could be directly sent to a CommandExecutor
-
convertContextOf
public static TextComponent convertContextOf(com.mojang.brigadier.exceptions.CommandSyntaxException exception) ConvertsCommandSyntaxException.getContext()
to a component.- Parameters:
exception
- the exception provided- Returns:
- converted context, or null
-
getMessage
Returns the message provided.- Returns:
- message
-
getString
- Specified by:
getString
in interfacecom.mojang.brigadier.Message
-
toString
-