Class CommandUsage
java.lang.Object
ch.njol.skript.command.CommandUsage
Deprecated, for removal: This API element is subject to removal in a future version.
There is no direct replacement for this class.
Holds info about the usage of a command.
TODO: replace with record when java 17
-
Constructor Summary
ConstructorsConstructorDescriptionCommandUsage(@Nullable VariableString usage, String defaultUsage) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.getUsage()Deprecated, for removal: This API element is subject to removal in a future version.Get the usage message without an event to evaluate it.getUsage(@Nullable org.bukkit.event.Event event) Deprecated, for removal: This API element is subject to removal in a future version.net.kyori.adventure.text.ComponentgetUsageComponent(@Nullable org.bukkit.event.Event event) Deprecated, for removal: This API element is subject to removal in a future version.toString()Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
CommandUsage
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
usage- The dynamic usage message, can contain expressions.defaultUsage- A fallback usage message for use in non-event environments.
-
-
Method Details
-
getRawUsage
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The usage message as a
VariableString.
-
getUsage
Deprecated, for removal: This API element is subject to removal in a future version.Get the usage message without an event to evaluate it.- Returns:
- The evaluated usage message.
-
getUsage
Deprecated, for removal: This API element is subject to removal in a future version.- 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) Deprecated, for removal: This API element is subject to removal in a future version.- 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
-