Class PlayerCommandBase

java.lang.Object
com.ordwen.odailyquests.api.commands.player.PlayerMessages
com.ordwen.odailyquests.api.commands.player.PlayerCommandBase
All Implemented Interfaces:
PlayerCommand, PlayerCommandCompleter
Direct Known Subclasses:
MeCommand, PRerollCommand, PShowCommand

public abstract class PlayerCommandBase extends PlayerMessages implements PlayerCommand, PlayerCommandCompleter
Base class providing common functionality for player-related commands.

This abstract class implements the PlayerCommand and PlayerCommandCompleter interfaces, offering default behaviors for both command execution and tab-completion handling. Subclasses of this class can implement specific command logic and customize tab-completion behavior.

  • Constructor Details

    • PlayerCommandBase

      public PlayerCommandBase()
  • Method Details

    • onTabComplete

      public List<String> onTabComplete(@NotNull org.bukkit.command.CommandSender sender, String[] args)
      Provides tab-completion suggestions for the command.

      This method is called automatically by Bukkit when the user presses the TAB key while typing the command. By default, this implementation returns an empty list, which disables tab-completion.

      To enable suggestions, override this method in your command class and return a list of possible completions. Returning null allows Bukkit to auto-complete player names.

      Specified by:
      onTabComplete in interface PlayerCommandCompleter
      Parameters:
      sender - the source of the command (player or console)
      args - the current command arguments
      Returns:
      a list of completions, an empty list to disable suggestions, or null to let Bukkit suggest player names