Interface CommandArgument<W extends BetterCommandSource>

Type Parameters:
W - source
All Known Implementing Classes:
CommandModule

public interface CommandArgument<W extends BetterCommandSource>
Refers command argument
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String[]
    Gets command aliases
    <S> @NotNull List<com.mojang.brigadier.builder.LiteralArgumentBuilder<S>>
    build(@NotNull Function<S,W> mapper)
    Build a brigadier command
    @NotNull MessageFunction<W>
    Gets command description
    @NotNull String
    Gets command name
    @Nullable String
    Gets command permission
    @Nullable net.kyori.adventure.text.Component
    usage(W w)
    Gets usage of this command
  • Method Details

    • name

      @NotNull @NotNull String name()
      Gets command name
      Returns:
      name
    • description

      @NotNull @NotNull MessageFunction<W> description()
      Gets command description
      Returns:
      description
    • build

      @NotNull <S> @NotNull List<com.mojang.brigadier.builder.LiteralArgumentBuilder<S>> build(@NotNull @NotNull Function<S,W> mapper)
      Build a brigadier command
      Type Parameters:
      S - source class of W (normally it is a CommandSourceStack)
      Parameters:
      mapper - class wrapper
      Returns:
      brigadier command
    • aliases

      @NotNull @NotNull String[] aliases()
      Gets command aliases
      Returns:
      aliases
    • usage

      @Nullable @Nullable net.kyori.adventure.text.Component usage(@NotNull W w)
      Gets usage of this command
      Parameters:
      w - source
      Returns:
      usage component
    • permission

      @Nullable @Nullable String permission()
      Gets command permission
      Returns:
      permission key or null if not set