Class CommandUsage
java.lang.Object
ch.njol.skript.command.CommandUsage
Holds info about the usage of a command.
TODO: replace with record when java 17
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUsage()Get the usage message without an event to evaluate it.getUsage(@Nullable org.bukkit.event.Event event) net.kyori.adventure.text.ComponentgetUsageComponent(@Nullable org.bukkit.event.Event event) toString()
-
Constructor Details
-
CommandUsage
- Parameters:
usage- The dynamic usage message, can contain expressions.defaultUsage- A fallback usage message for use in non-event environments.
-
-
Method Details
-
getRawUsage
- Returns:
- The usage message as a
VariableString.
-
getUsage
Get the usage message without an event to evaluate it.- Returns:
- The evaluated usage message.
-
getUsage
- Parameters:
event- The event used to evaluate the usage message.- Returns:
- The evaluated usage message.
-
getUsageComponent
public net.kyori.adventure.text.Component getUsageComponent(@Nullable @Nullable org.bukkit.event.Event event) - Parameters:
event- The event used to evaluate the usage message.- Returns:
- The evaluated usage message as an Adventure
Componentwith Skript color tags (<red>,&c, etc.) parsed into real chat formatting viaTextComponentParser.parse(Object). Command usage strings are server-controlled, so unsafe tags are appropriate.
-
toString
-