Annotation Type Command


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Command
    This annotation is used for defining a method to be a PluginCommand, the corp of the method will be executed when someone will perform a command with the selected name
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String description
      The description of the command is what is show to players when using /help
      java.lang.String name
      The name of the command is what the player need to type for executing this command
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] aliases
      The command aliases are used for perform a command using aliases
      boolean completion
      Define if the command method have a Completer method used for tab completion somewhere in the class by default it's set to false
      int maxArgs
      Define the max args allowed for perform this command If player enter more args than this value the command will not be executed by default the value is Integer.MAX_VALUE
      int minArgs
      Define the min args allowed for perform this command If player enter less args than this value the command will not be executed by default the value is 0
      java.lang.String permission
      The permission is the permission needed by the command sender to perform this command by default there is no permission needed
      java.lang.String permissionMessage
      The message send to player who perform this command without the permission by default it's set to "You don't have the permission to perform this command"
      Sender sender
      The command method will be executed only if the sender of the command is the sender needed by default all sender are allowed
      java.lang.String usage
      Usage is the message sent to the player when the command is badly formatted the default value is /commandname
    • Element Detail

      • name

        java.lang.String name
        The name of the command is what the player need to type for executing this command
        Returns:
        The name of this command
      • description

        java.lang.String description
        The description of the command is what is show to players when using /help
        Returns:
        The description of this command
      • permission

        java.lang.String permission
        The permission is the permission needed by the command sender to perform this command by default there is no permission needed
        Returns:
        The permission needed to perform this command
        Default:
        ""
      • usage

        java.lang.String usage
        Usage is the message sent to the player when the command is badly formatted the default value is /commandname
        Returns:
        The usage message of this command
        Default:
        "/<command>"
      • sender

        Sender sender
        The command method will be executed only if the sender of the command is the sender needed by default all sender are allowed
        Returns:
        The sender who should use the command
        Default:
        net.frozenspace.frostlib.command.Sender.ALL
      • aliases

        java.lang.String[] aliases
        The command aliases are used for perform a command using aliases
        Returns:
        The aliases of the command
        Default:
        {}
      • completion

        boolean completion
        Define if the command method have a Completer method used for tab completion somewhere in the class by default it's set to false
        Returns:
        Yes if tab completion is enabled false if not
        Default:
        false
      • maxArgs

        int maxArgs
        Define the max args allowed for perform this command If player enter more args than this value the command will not be executed by default the value is Integer.MAX_VALUE
        Returns:
        The max args allowed for this command
        Default:
        2147483647
      • minArgs

        int minArgs
        Define the min args allowed for perform this command If player enter less args than this value the command will not be executed by default the value is 0
        Returns:
        The min args allowed for this command
        Default:
        0
      • permissionMessage

        java.lang.String permissionMessage
        The message send to player who perform this command without the permission by default it's set to "You don't have the permission to perform this command"
        Returns:
        The no permission message to send
        Default:
        "You don\'t have the permission to perform this command"