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 TextComponentconvertContextOf(com.mojang.brigadier.exceptions.CommandSyntaxException exception) ConvertsCommandSyntaxException.getContext()to a component.static BaseComponentconvertSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Converts the providedCommandSyntaxExceptioninto a BungeeCord style message.static BungeeMessagecreateOfTranslatable(String id, ChatColor color, Object... with) A utility method to create aBungeeMessagewith a message ofTranslatableComponentwith the appropriate translationidReturns the message provided.toString()
-
Constructor Details
-
BungeeMessage
Creates a newBungeeMessage- Parameters:
text- components
-
-
Method Details
-
createOfTranslatable
A utility method to create aBungeeMessagewith a message ofTranslatableComponentwith the appropriate translationid- Parameters:
id- the translation idwith- theStrings andBaseComponents to use in the translation- Returns:
- new bungee message instance
-
convertSyntaxException
public static BaseComponent convertSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException exception) Converts the providedCommandSyntaxExceptioninto 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:
getStringin interfacecom.mojang.brigadier.Message
-
toString
-