Class CommandUsage

java.lang.Object
ch.njol.skript.command.CommandUsage

@Deprecated(since="2.17", forRemoval=true) public class CommandUsage extends Object
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

    Constructors
    Constructor
    Description
    CommandUsage(@Nullable VariableString usage, String defaultUsage)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    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.Component
    getUsageComponent(@Nullable org.bukkit.event.Event event)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CommandUsage

      public CommandUsage(@Nullable @Nullable VariableString usage, String defaultUsage)
      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

      public VariableString getRawUsage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The usage message as a VariableString.
    • getUsage

      public String 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

      public String getUsage(@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.
    • 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 Component with Skript color tags (<red>, &c, etc.) parsed into real chat formatting via TextComponentParser.parse(Object). Command usage strings are server-controlled, so unsafe tags are appropriate.
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object