Skip to content

Instantly share code, notes, and snippets.

@thinkverse
Created March 14, 2020 16:22
Show Gist options
  • Save thinkverse/e63caaaafea5d944fb839e8b81a6e5b4 to your computer and use it in GitHub Desktop.
Save thinkverse/e63caaaafea5d944fb839e8b81a6e5b4 to your computer and use it in GitHub Desktop.
Tab Complete
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
return (args.length == 1) ? Bukkit.getServer().getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList()) : Collections.emptyList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment