Files
Paper/paper-api/src/main/java/org/bukkit/command/TabCompleter.java
2022-02-21 12:02:28 +11:00

28 lines
1.0 KiB
Java

package org.bukkit.command;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a class which can suggest tab completions for commands.
*/
public interface TabCompleter {
/**
* Requests a list of possible completions for a command argument.
*
* @param sender Source of the command. For players tab-completing a
* command inside of a command block, this will be the player, not
* the command block.
* @param command Command which was executed
* @param label Alias of the command which was used
* @param args The arguments passed to the command, including final
* partial argument to be completed
* @return A List of possible completions for the final argument, or null
* to default to the command executor
*/
@Nullable
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args);
}