Class AbstractStellarCommand
-
- All Implemented Interfaces:
public abstract class AbstractStellarCommand<T extends AbstractStellarCommand<T>>
This is the base of any command, whether it's an argument or a root command.
-
-
Field Summary
Fields Modifier and Type Field Description private NMS
nms
private final Set<String>
aliases
private final List<ExecutableRequirement<?>>
requirements
private final Set<AbstractStellarArgument<?, ?>>
arguments
private final Set<ExecutableExecution<?>>
executions
private final Set<ExecutableRunnable<?>>
runnables
private final Set<ExecutableExecution<?>>
failureExecutions
private final Set<ExecutableExecution<?>>
globalFailureExecutions
private HideDefaultFailureMessages
hideDefaultFailureMessages
private final String
name
-
Constructor Summary
Constructors Constructor Description AbstractStellarCommand(String name)
-
Method Summary
Modifier and Type Method Description final NMS
getNms()
final Unit
setNms(NMS nms)
final Set<String>
getAliases()
final List<ExecutableRequirement<?>>
getRequirements()
final Set<AbstractStellarArgument<?, ?>>
getArguments()
final Set<ExecutableExecution<?>>
getExecutions()
final Set<ExecutableRunnable<?>>
getRunnables()
final Set<ExecutableExecution<?>>
getFailureExecutions()
Set<ExecutableExecution<?>>
getGlobalFailureExecutions()
final HideDefaultFailureMessages
getHideDefaultFailureMessages()
final Unit
setHideDefaultFailureMessages(HideDefaultFailureMessages hideDefaultFailureMessages)
final String
getName()
final T
addAlias(String alias)
Add a command alias in addition to the existing command aliases. final T
addAliases(String aliases)
Adds command aliases in addition to the existing command aliases. final T
clearAliases()
Clears all command aliases. final <C extends CommandSender> T
addRequirement(Function1<C, Boolean> requirement)
Adds a requirement that must be met for the command to be available to the player. final T
addRequirement(StellarRequirement<CommandSender> requirement)
Adds a requirement that must be met for the command to be available to the player. final T
addRequirement(String permission)
Adds a Bukkit permission requirement for the command to be available to the player. final T
addRequirement(Integer level)
Adds a level requirement for the command to be available to the player. final T
addRequirements(String permissions)
Adds multiple Bukkit permission requirements for the command to be available to the player. final T
addRequirements(Integer levels)
Adds multiple level requirements for the command to be available to the player. final <C extends CommandSender> T
addExecution(Function1<CommandContext<C>, Unit> execution)
Adds an execution to the command. final T
addExecution(StellarExecution<CommandSender> execution)
Adds an execution to the command. final <C extends CommandSender> T
addAsyncExecution(Function1<CommandContext<C>, Unit> execution)
Adds an async execution to the command. final T
addAsyncExecution(StellarExecution<CommandSender> execution)
Adds an async execution to the command. final <C extends CommandSender> T
addRunnable(Function1<CommandContext<C>, Boolean> runnable)
Adds a runnable to the command. final T
addRunnable(StellarRunnable<CommandSender> runnable)
Adds a runnable to the command. final <C extends CommandSender> T
addAsyncRunnable(Function1<CommandContext<C>, Boolean> runnable)
Adds an async runnable to the command. final T
addAsyncRunnable(StellarRunnable<CommandSender> runnable)
Adds an async runnable to the command. final <C extends CommandSender> T
addFailureExecution(Function1<CommandContext<C>, Unit> execution)
Adds a failure execution to the command to be displayed when the command fails. final T
addFailureExecution(StellarExecution<CommandSender> execution)
Adds a failure execution to the command to be displayed when the command fails. final <C extends CommandSender> T
addGlobalFailureExecution(Function1<CommandContext<C>, Unit> execution)
Adds a failure execution to the root command to be displayed when the command fails. final T
addGlobalFailureExecution(StellarExecution<CommandSender> execution)
Adds a failure execution to the root command to be displayed when the command fails. final T
addFailureMessage(Component message)
Adds a failure message to the command to be displayed when the command fails. final T
addFailureMessage(String message)
Adds a failure message to the command to be displayed when the command fails. final T
addGlobalFailureMessage(Component message)
Adds a failure message to the root command to be displayed when the command fails. final T
addGlobalFailureMessage(String message)
Adds a failure message to the root command to be displayed when the command fails. final T
hideDefaultFailureMessages(Boolean hide, Boolean global)
Hides the default Minecraft failure messages for the command. final T
hideDefaultFailureMessages(Boolean hide)
Hides the default Minecraft failure messages for the command. final T
hideDefaultFailureMessages()
Hides the default Minecraft failure messages for the command. Boolean
hasGlobalHiddenDefaultFailureMessages()
abstract T
setInformation(String name, String text)
Adds or sets a piece of information with the given name and text. abstract T
setDescription(String text)
Sets the description of this command with the given text. abstract T
setUsageText(String text)
Sets the usage text of this command with the given text. abstract T
clearInformation()
Clears all the information. abstract T
register(JavaPlugin plugin)
Registeres the command with the given plugin. final <T extends AbstractStellarArgument<?, ?>> T
addArgument(T argument)
Adds the given argument to the command and return the argument. final LiteralArgument
addArgument(String name, String aliases)
Adds a LiteralArgument to the command with the given name and aliases. final LiteralArgument
addLiteralArgument(String name, String aliases)
Adds a LiteralArgument to the command with the given name and aliases. final BooleanArgument
addBooleanArgument(String name)
Adds a BooleanArgument to the command with the given name. final DoubleArgument
addDoubleArgument(String name, Double minimum, Double maximum)
Adds a DoubleArgument to the command with the given name. final DoubleArgument
addDoubleArgument(String name, Double minimum)
Adds a DoubleArgument to the command with the given name. final DoubleArgument
addDoubleArgument(String name)
Adds a DoubleArgument to the command with the given name. final FloatArgument
addFloatArgument(String name, Float minimum, Float maximum)
Adds a FloatArgument to the command with the given name. final FloatArgument
addFloatArgument(String name, Float minimum)
Adds a FloatArgument to the command with the given name. final FloatArgument
addFloatArgument(String name)
Adds a FloatArgument to the command with the given name. final IntegerArgument
addIntegerArgument(String name, Integer minimum, Integer maximum)
Adds an IntegerArgument to the command with the given name. final IntegerArgument
addIntegerArgument(String name, Integer minimum)
Adds an IntegerArgument to the command with the given name. final IntegerArgument
addIntegerArgument(String name)
Adds an IntegerArgument to the command with the given name. final LongArgument
addLongArgument(String name, Long minimum, Long maximum)
Adds a LongArgument to the command with the given name. final LongArgument
addLongArgument(String name, Long minimum)
Adds a LongArgument to the command with the given name. final LongArgument
addLongArgument(String name)
Adds a LongArgument to the command with the given name. final StringArgument
addStringArgument(String name, StringType type)
Adds a StringArgument to the command with the given name. final StringArgument
addStringArgument(String name)
Adds a StringArgument to the command with the given name. final BlockDataArgument
addBlockDataArgument(String name)
Adds a BlockDataArgument to the command with the given name. final BlockPredicateArgument
addBlockPredicateArgument(String name)
Adds a BlockPredicateArgument to the command with the given name. final EntityAnchorArgument
addEntityAnchorArgument(String name)
Adds an EntityAnchorArgument to the command with the given name. final EntityArgument
addEntityArgument(String name, EntityDisplayType type)
Adds an EntityArgument to the command with the given name. final ItemSlotArgument
addItemSlotArgument(String name, Boolean multiple)
Adds an ItemSlotArgument to the command with the given name. final ItemStackArgument
addItemStackArgument(String name)
Adds an ItemStackArgument to the command with the given name. final ItemStackPredicateArgument
addItemStackPredicateArgument(String name)
Adds an ItemStackPredicateArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list, Function1<String, String> tooltip, StringType type)
Adds a ListArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list, Function1<String, String> tooltip)
Adds a ListArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list)
Adds a ListArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, List<String> list, Function1<String, String> tooltip, StringType type)
Adds a ListArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, List<String> list, Function1<String, String> tooltip)
Adds a ListArgument to the command with the given name. final ListArgument<String, String>
addListArgument(String name, List<String> list)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command with the given name. final <T extends Any> ListArgument<T, String>
addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Any, R extends Any> ListArgument<T, R>
addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand. final <T extends Enum<T>> EnumArgument<T>
addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter, Function2<CommandSender, String, Enum<T>> parse, Boolean async)
Adds an EnumArgument to the command with the given name. final <T extends Enum<T>> EnumArgument<T>
addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter, Function2<CommandSender, String, Enum<T>> parse)
Adds an EnumArgument to the command with the given name. final <T extends Enum<T>> EnumArgument<T>
addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter)
Adds an EnumArgument to the command with the given name. final <T extends Enum<T>> EnumArgument<T>
addEnumArgument(String name)
Adds an EnumArgument to the command with the given name. final <T extends Enum<T>> EnumArgument<T>
addEnumArgument(String name, EnumFormatting formatting, Boolean async)
Adds an EnumArgument to the command with the given name. final OnlinePlayersArgument
addOnlinePlayersArgument(String name, Function1<Player, Boolean> filter, Boolean async)
Adds an OnlinePlayersArgument to the command with the given name. final OnlinePlayersArgument
addOnlinePlayersArgument(String name, Function1<Player, Boolean> filter)
Adds an OnlinePlayersArgument to the command with the given name. final OnlinePlayersArgument
addOnlinePlayersArgument(String name)
Adds an OnlinePlayersArgument to the command with the given name. final AngleArgument
addAngleArgument(String name)
Adds an AngleArgument to the command with the given name. final AxisArgument
addAxisArgument(String name)
Adds an AxisArgument to the command with the given name. final DoubleRangeArgument
addDoubleRangeArgument(String name)
Adds a DoubleRangeArgument to the command with the given name. final IntRangeArgument
addIntRangeArgument(String name)
Adds an IntRangeArgument to the command with the given name. final OperationArgument
addOperationArgument(String name)
Adds an OperationArgument to the command with the given name. final RotationArgument
addRotationArgument(String name)
Adds a RotationArgument to the command with the given name. final TimeArgument
addTimeArgument(String name, Integer minimum)
Adds a TimeArgument to the command with the given name. final TimeArgument
addTimeArgument(String name)
Adds a TimeArgument to the command with the given name. final NamespacedKeyArgument
addNamespacedKeyArgument(String name)
Adds a NamespacedKeyArgument to the command with the given name. final UUIDArgument
addUUIDArgument(String name)
Adds a UUIDArgument to the command with the given name. final PhraseArgument
addPhraseArgument(String name)
Adds a PhraseArgument to the command with the given name. final GameModeArgument
addGameModeArgument(String name)
Adds a GameModeArgument to the command with the given name. final GameProfileArgument
addGameProfileArgument(String name)
Adds a GameProfileArgument to the command with the given name. final DisplaySlotArgument
addDisplaySlotArgument(String name)
Adds a DisplaySlotArgument to the command with the given name. final ObjectiveArgument
addObjectiveArgument(String name)
Adds an ObjectiveArgument to the command with the given name. final ObjectiveCriteriaArgument
addObjectiveCriteriaArgument(String name)
Adds an ObjectiveCriteriaArgument to the command with the given name. final ScoreHolderArgument
addScoreHolderArgument(String name, ScoreHolderType type)
Adds a ScoreHolderArgument to the command with the given name. final TeamArgument
addTeamArgument(String name)
Adds a TeamArgument to the command with the given name. final LootTableArgument
addLootTableArgument(String name)
Adds a LootTableArgument to the command with the given name. final MirrorArgument
addMirrorArgument(String name)
Adds a MirrorArgument to the command with the given name. final StructureRotationArgument
addStructureRotationArgument(String name)
Adds a StructureRotationArgument to the command with the given name. final ColorArgument
addColorArgument(String name)
Adds a ColorArgument to the command with the given name. final ComponentArgument
addComponentArgument(String name)
Adds a ComponentArgument to the command with the given name. final MessageArgument
addMessageArgument(String name)
Adds a MessageArgument to the command with the given name. final StyleArgument
addStyleArgument(String name)
Adds a StyleArgument to the command with the given name. final EnvironmentArgument
addEnvironmentArgument(String name)
Adds an EnvironmentArgument to the command with the given name. final HeightMapArgument
addHeightMapArgument(String name)
Adds a HeightMapArgument to the command with the given name. final LocationArgument
addLocationArgument(String name, LocationType type)
Adds a LocationArgument to the command with the given name. final ParticleArgument
addParticleArgument(String name)
Adds a ParticleArgument to the command with the given name. -
-
Constructor Detail
-
AbstractStellarCommand
AbstractStellarCommand(String name)
- Parameters:
name
- The command name.
-
-
Method Detail
-
getAliases
final Set<String> getAliases()
-
getRequirements
final List<ExecutableRequirement<?>> getRequirements()
-
getArguments
final Set<AbstractStellarArgument<?, ?>> getArguments()
-
getExecutions
final Set<ExecutableExecution<?>> getExecutions()
-
getRunnables
final Set<ExecutableRunnable<?>> getRunnables()
-
getFailureExecutions
final Set<ExecutableExecution<?>> getFailureExecutions()
-
getGlobalFailureExecutions
Set<ExecutableExecution<?>> getGlobalFailureExecutions()
-
getHideDefaultFailureMessages
final HideDefaultFailureMessages getHideDefaultFailureMessages()
-
setHideDefaultFailureMessages
final Unit setHideDefaultFailureMessages(HideDefaultFailureMessages hideDefaultFailureMessages)
-
addAlias
final T addAlias(String alias)
Add a command alias in addition to the existing command aliases.
-
addAliases
final T addAliases(String aliases)
Adds command aliases in addition to the existing command aliases.
-
clearAliases
final T clearAliases()
Clears all command aliases.
-
addRequirement
final <C extends CommandSender> T addRequirement(Function1<C, Boolean> requirement)
Adds a requirement that must be met for the command to be available to the player. Only works in Kotlin.
- Parameters:
requirement
- The condition that must be met.- Returns:
The modified command object.
-
addRequirement
final T addRequirement(StellarRequirement<CommandSender> requirement)
Adds a requirement that must be met for the command to be available to the player. Also works in Java.
- Parameters:
requirement
- The condition that must be met.- Returns:
The modified command object.
-
addRequirement
final T addRequirement(String permission)
Adds a Bukkit permission requirement for the command to be available to the player.
- Parameters:
permission
- The permission string.- Returns:
The modified command object.
-
addRequirement
final T addRequirement(Integer level)
Adds a level requirement for the command to be available to the player.
Note: this only applies to players, not all command senders.
- Parameters:
level
- The required permission level.- Returns:
The modified command object.
-
addRequirements
final T addRequirements(String permissions)
Adds multiple Bukkit permission requirements for the command to be available to the player.
- Parameters:
permissions
- The permission strings.- Returns:
The modified command object.
-
addRequirements
final T addRequirements(Integer levels)
Adds multiple level requirements for the command to be available to the player.
Note: this only applies to players, not all command senders.
- Parameters:
levels
- The required permission levels.- Returns:
The modified command object.
-
addExecution
final <C extends CommandSender> T addExecution(Function1<CommandContext<C>, Unit> execution)
Adds an execution to the command. Only works in Kotlin.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addExecution
final T addExecution(StellarExecution<CommandSender> execution)
Adds an execution to the command. Also works in Java.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addAsyncExecution
final <C extends CommandSender> T addAsyncExecution(Function1<CommandContext<C>, Unit> execution)
Adds an async execution to the command. Only works in Kotlin.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addAsyncExecution
final T addAsyncExecution(StellarExecution<CommandSender> execution)
Adds an async execution to the command. Also works in Java.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addRunnable
final <C extends CommandSender> T addRunnable(Function1<CommandContext<C>, Boolean> runnable)
Adds a runnable to the command. Only works in Kotlin.
- Parameters:
runnable
- The execution block.- Returns:
The modified command object.
-
addRunnable
final T addRunnable(StellarRunnable<CommandSender> runnable)
Adds a runnable to the command. Also works in Java.
- Parameters:
runnable
- The execution block.- Returns:
The modified command object.
-
addAsyncRunnable
final <C extends CommandSender> T addAsyncRunnable(Function1<CommandContext<C>, Boolean> runnable)
Adds an async runnable to the command. Only works in Kotlin.
- Parameters:
runnable
- The execution block.- Returns:
The modified command object.
-
addAsyncRunnable
final T addAsyncRunnable(StellarRunnable<CommandSender> runnable)
Adds an async runnable to the command. Also works in Java.
- Parameters:
runnable
- The execution block.- Returns:
The modified command object.
-
addFailureExecution
final <C extends CommandSender> T addFailureExecution(Function1<CommandContext<C>, Unit> execution)
Adds a failure execution to the command to be displayed when the command fails. Only works in Kotlin.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addFailureExecution
final T addFailureExecution(StellarExecution<CommandSender> execution)
Adds a failure execution to the command to be displayed when the command fails. Also works in Java.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addGlobalFailureExecution
final <C extends CommandSender> T addGlobalFailureExecution(Function1<CommandContext<C>, Unit> execution)
Adds a failure execution to the root command to be displayed when the command fails. Only works in Kotlin.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addGlobalFailureExecution
final T addGlobalFailureExecution(StellarExecution<CommandSender> execution)
Adds a failure execution to the root command to be displayed when the command fails. Also works in Java.
- Parameters:
execution
- The execution block.- Returns:
The modified command object.
-
addFailureMessage
final T addFailureMessage(Component message)
Adds a failure message to the command to be displayed when the command fails.
- Parameters:
message
- The message component to be sent.- Returns:
The modified command object.
-
addFailureMessage
final T addFailureMessage(String message)
Adds a failure message to the command to be displayed when the command fails.
- Parameters:
message
- The message to be sent.- Returns:
The modified command object.
-
addGlobalFailureMessage
final T addGlobalFailureMessage(Component message)
Adds a failure message to the root command to be displayed when the command fails.
- Parameters:
message
- The message component to be sent.- Returns:
The modified command object.
-
addGlobalFailureMessage
final T addGlobalFailureMessage(String message)
Adds a failure message to the root command to be displayed when the command fails.
- Parameters:
message
- The message to be sent.- Returns:
The modified command object.
-
hideDefaultFailureMessages
@JvmOverloads() final T hideDefaultFailureMessages(Boolean hide, Boolean global)
Hides the default Minecraft failure messages for the command.
- Parameters:
hide
- Whether to hide the messages.global
- Whether to apply it on the root command.- Returns:
The modified command object.
-
hideDefaultFailureMessages
@JvmOverloads() final T hideDefaultFailureMessages(Boolean hide)
Hides the default Minecraft failure messages for the command.
- Parameters:
hide
- Whether to hide the messages.- Returns:
The modified command object.
-
hideDefaultFailureMessages
@JvmOverloads() final T hideDefaultFailureMessages()
Hides the default Minecraft failure messages for the command.
- Returns:
The modified command object.
-
hasGlobalHiddenDefaultFailureMessages
@ApiStatus.Internal() Boolean hasGlobalHiddenDefaultFailureMessages()
-
setInformation
abstract T setInformation(String name, String text)
Adds or sets a piece of information with the given name and text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
setDescription
abstract T setDescription(String text)
Sets the description of this command with the given text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
setUsageText
abstract T setUsageText(String text)
Sets the usage text of this command with the given text. It will be stored as information, to be displayed as a help topic.
- Returns:
The modified command object.
-
clearInformation
abstract T clearInformation()
Clears all the information.
- Returns:
The modified command object.
-
register
abstract T register(JavaPlugin plugin)
Registeres the command with the given plugin.
- Parameters:
plugin
- The givenJavaPlugin
instance.- Returns:
The registered command object.
-
addArgument
final <T extends AbstractStellarArgument<?, ?>> T addArgument(T argument)
Adds the given argument to the command and return the argument.
-
addArgument
final LiteralArgument addArgument(String name, String aliases)
Adds a LiteralArgument to the command with the given name and aliases.
- Returns:
The created BooleanArgument.
-
addLiteralArgument
final LiteralArgument addLiteralArgument(String name, String aliases)
Adds a LiteralArgument to the command with the given name and aliases.
- Returns:
The created BooleanArgument.
-
addBooleanArgument
final BooleanArgument addBooleanArgument(String name)
Adds a BooleanArgument to the command with the given name.
- Returns:
The created BooleanArgument.
-
addDoubleArgument
@JvmOverloads() final DoubleArgument addDoubleArgument(String name, Double minimum, Double maximum)
Adds a DoubleArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Double.MIN_VALUE).maximum
- The maximum allowed value (default: Double.MAX_VALUE).- Returns:
The created DoubleArgument.
-
addDoubleArgument
@JvmOverloads() final DoubleArgument addDoubleArgument(String name, Double minimum)
Adds a DoubleArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Double.MIN_VALUE).- Returns:
The created DoubleArgument.
-
addDoubleArgument
@JvmOverloads() final DoubleArgument addDoubleArgument(String name)
Adds a DoubleArgument to the command with the given name.
- Returns:
The created DoubleArgument.
-
addFloatArgument
@JvmOverloads() final FloatArgument addFloatArgument(String name, Float minimum, Float maximum)
Adds a FloatArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Float.MIN_VALUE).maximum
- The maximum allowed value (default: Float.MAX_VALUE).- Returns:
The created FloatArgument.
-
addFloatArgument
@JvmOverloads() final FloatArgument addFloatArgument(String name, Float minimum)
Adds a FloatArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Float.MIN_VALUE).- Returns:
The created FloatArgument.
-
addFloatArgument
@JvmOverloads() final FloatArgument addFloatArgument(String name)
Adds a FloatArgument to the command with the given name.
- Returns:
The created FloatArgument.
-
addIntegerArgument
@JvmOverloads() final IntegerArgument addIntegerArgument(String name, Integer minimum, Integer maximum)
Adds an IntegerArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Int.MIN_VALUE).maximum
- The maximum allowed value (default: Int.MAX_VALUE).- Returns:
The created IntegerArgument.
-
addIntegerArgument
@JvmOverloads() final IntegerArgument addIntegerArgument(String name, Integer minimum)
Adds an IntegerArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Int.MIN_VALUE).- Returns:
The created IntegerArgument.
-
addIntegerArgument
@JvmOverloads() final IntegerArgument addIntegerArgument(String name)
Adds an IntegerArgument to the command with the given name.
- Returns:
The created IntegerArgument.
-
addLongArgument
@JvmOverloads() final LongArgument addLongArgument(String name, Long minimum, Long maximum)
Adds a LongArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Long.MIN_VALUE).maximum
- The maximum allowed value (default: Long.MAX_VALUE).- Returns:
The created LongArgument.
-
addLongArgument
@JvmOverloads() final LongArgument addLongArgument(String name, Long minimum)
Adds a LongArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed value (default: Long.MIN_VALUE).- Returns:
The created LongArgument.
-
addLongArgument
@JvmOverloads() final LongArgument addLongArgument(String name)
Adds a LongArgument to the command with the given name.
- Returns:
The created LongArgument.
-
addStringArgument
@JvmOverloads() final StringArgument addStringArgument(String name, StringType type)
Adds a StringArgument to the command with the given name.
- Returns:
The created StringArgument.
-
addStringArgument
@JvmOverloads() final StringArgument addStringArgument(String name)
Adds a StringArgument to the command with the given name.
- Returns:
The created StringArgument.
-
addBlockDataArgument
final BlockDataArgument addBlockDataArgument(String name)
Adds a BlockDataArgument to the command with the given name.
- Returns:
The created BlockDataArgument.
-
addBlockPredicateArgument
final BlockPredicateArgument addBlockPredicateArgument(String name)
Adds a BlockPredicateArgument to the command with the given name.
- Returns:
The created BlockPredicateArgument.
-
addEntityAnchorArgument
final EntityAnchorArgument addEntityAnchorArgument(String name)
Adds an EntityAnchorArgument to the command with the given name.
- Returns:
The created EntityAnchorArgument.
-
addEntityArgument
final EntityArgument addEntityArgument(String name, EntityDisplayType type)
Adds an EntityArgument to the command with the given name.
- Returns:
The created EntityArgument.
-
addItemSlotArgument
final ItemSlotArgument addItemSlotArgument(String name, Boolean multiple)
Adds an ItemSlotArgument to the command with the given name.
- Returns:
The created ItemSlotArgument.
-
addItemStackArgument
final ItemStackArgument addItemStackArgument(String name)
Adds an ItemStackArgument to the command with the given name.
- Returns:
The created ItemStackArgument.
-
addItemStackPredicateArgument
final ItemStackPredicateArgument addItemStackPredicateArgument(String name)
Adds an ItemStackPredicateArgument to the command with the given name.
- Returns:
The created ItemStackPredicateArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list, Function1<String, String> tooltip, StringType type)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- A function return a list of possible values.tooltip
- A function that assigns each suggestion with a tooltip.type
- The StringType it will use in the StringArgument.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list, Function1<String, String> tooltip)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- A function return a list of possible values.tooltip
- A function that assigns each suggestion with a tooltip.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<String>> list)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- A function return a list of possible values.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, List<String> list, Function1<String, String> tooltip, StringType type)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- The list of possible values.tooltip
- A function that assigns each suggestion with a tooltip.type
- The StringType it will use in the StringArgument.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, List<String> list, Function1<String, String> tooltip)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- The list of possible values.tooltip
- A function that assigns each suggestion with a tooltip.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final ListArgument<String, String> addListArgument(String name, List<String> list)
Adds a ListArgument to the command with the given name. It uses its StringArgument as a base wrapper.
- Parameters:
list
- The list of possible values.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, String> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a String (default: usestoString()
).- Returns:
The created ListArgument.
-
addListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, List<T> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- The list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any> ListArgument<T, String> addAdvancedListArgument(String name, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, String, T> parse)
Adds a ListArgument to the command with the given name.
- Parameters:
list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, List<T> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- The list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter, Boolean async)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse, Function2<CommandSender, T, Suggestion> converter)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.converter
- A function to convert a value into a Suggestion (default: usestoString()
).- Returns:
The created ListArgument.
-
addAdvancedListArgument
@JvmOverloads() final <T extends Any, R extends Any> ListArgument<T, R> addAdvancedListArgument(AbstractStellarArgument<?, R> type, Function1<CommandContext<CommandSender>, List<T>> list, Function2<CommandSender, R, T> parse)
Adds a ListArgument to the command wrapped around the given AbstractStellarCommand.
- Parameters:
type
- The base argument the list is wrapped around to.list
- A function returning the list of possible values.parse
- A function to parse the returned String into typeT
.- Returns:
The created ListArgument.
-
addEnumArgument
@JvmOverloads() final <T extends Enum<T>> EnumArgument<T> addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter, Function2<CommandSender, String, Enum<T>> parse, Boolean async)
Adds an EnumArgument to the command with the given name.
- Parameters:
converter
- A function providing a CommandSender and an Enum instance from the enum, returning the Suggestion sent to the player.parse
- A function providing a CommandSender and the argument input, returning the parsed Enum (default:enum.valueOf(input.uppercase())
).async
- Whether the suggestions should be gotten asynchronously (default:true
).- Returns:
The created EnumArgument.
-
addEnumArgument
@JvmOverloads() final <T extends Enum<T>> EnumArgument<T> addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter, Function2<CommandSender, String, Enum<T>> parse)
Adds an EnumArgument to the command with the given name.
- Parameters:
converter
- A function providing a CommandSender and an Enum instance from the enum, returning the Suggestion sent to the player.parse
- A function providing a CommandSender and the argument input, returning the parsed Enum (default:enum.valueOf(input.uppercase())
).- Returns:
The created EnumArgument.
-
addEnumArgument
@JvmOverloads() final <T extends Enum<T>> EnumArgument<T> addEnumArgument(String name, Function2<CommandSender, Enum<T>, Suggestion> converter)
Adds an EnumArgument to the command with the given name.
- Parameters:
converter
- A function providing a CommandSender and an Enum instance from the enum, returning the Suggestion sent to the player.- Returns:
The created EnumArgument.
-
addEnumArgument
@JvmOverloads() final <T extends Enum<T>> EnumArgument<T> addEnumArgument(String name)
Adds an EnumArgument to the command with the given name.
- Returns:
The created EnumArgument.
-
addEnumArgument
final <T extends Enum<T>> EnumArgument<T> addEnumArgument(String name, EnumFormatting formatting, Boolean async)
Adds an EnumArgument to the command with the given name.
- Parameters:
formatting
- The formatting style for the enum names (default: EnumFormatting.LOWERCASE).async
- Whether the suggestions should be gotten asynchronously (default:true
).- Returns:
The created EnumArgument.
-
addOnlinePlayersArgument
@JvmOverloads() final OnlinePlayersArgument addOnlinePlayersArgument(String name, Function1<Player, Boolean> filter, Boolean async)
Adds an OnlinePlayersArgument to the command with the given name. It is a list of all currently online players.
- Parameters:
filter
- A function to filter players (default: allows all players).async
- Whether the suggestions should be gotten asynchronously (default:false
).- Returns:
The created OnlinePlayersArgument, which returns a Player when parsed.
-
addOnlinePlayersArgument
@JvmOverloads() final OnlinePlayersArgument addOnlinePlayersArgument(String name, Function1<Player, Boolean> filter)
Adds an OnlinePlayersArgument to the command with the given name. It is a list of all currently online players.
- Parameters:
filter
- A function to filter players (default: allows all players).- Returns:
The created OnlinePlayersArgument, which returns a Player when parsed.
-
addOnlinePlayersArgument
@JvmOverloads() final OnlinePlayersArgument addOnlinePlayersArgument(String name)
Adds an OnlinePlayersArgument to the command with the given name. It is a list of all currently online players.
- Returns:
The created OnlinePlayersArgument, which returns a Player when parsed.
-
addAngleArgument
final AngleArgument addAngleArgument(String name)
Adds an AngleArgument to the command with the given name.
- Returns:
The created AngleArgument.
-
addAxisArgument
final AxisArgument addAxisArgument(String name)
Adds an AxisArgument to the command with the given name.
- Returns:
The created AxisArgument.
-
addDoubleRangeArgument
final DoubleRangeArgument addDoubleRangeArgument(String name)
Adds a DoubleRangeArgument to the command with the given name. Only works in Kotlin.
- Returns:
The created DoubleRangeArgument.
-
addIntRangeArgument
final IntRangeArgument addIntRangeArgument(String name)
Adds an IntRangeArgument to the command with the given name. Only works in Kotlin.
- Returns:
The created IntRangeArgument.
-
addOperationArgument
final OperationArgument addOperationArgument(String name)
Adds an OperationArgument to the command with the given name.
- Returns:
The created OperationArgument.
-
addRotationArgument
final RotationArgument addRotationArgument(String name)
Adds a RotationArgument to the command with the given name.
- Returns:
The created RotationArgument.
-
addTimeArgument
@JvmOverloads() final TimeArgument addTimeArgument(String name, Integer minimum)
Adds a TimeArgument to the command with the given name.
- Parameters:
minimum
- The minimum allowed time value (default:0
).- Returns:
The created TimeArgument.
-
addTimeArgument
@JvmOverloads() final TimeArgument addTimeArgument(String name)
Adds a TimeArgument to the command with the given name.
- Returns:
The created TimeArgument.
-
addNamespacedKeyArgument
final NamespacedKeyArgument addNamespacedKeyArgument(String name)
Adds a NamespacedKeyArgument to the command with the given name.
- Returns:
The created NamespacedKeyArgument.
-
addUUIDArgument
final UUIDArgument addUUIDArgument(String name)
Adds a UUIDArgument to the command with the given name.
- Returns:
The created UUIDArgument.
-
addPhraseArgument
final PhraseArgument addPhraseArgument(String name)
Adds a PhraseArgument to the command with the given name.
- Returns:
The created PhraseArgument.
-
addGameModeArgument
final GameModeArgument addGameModeArgument(String name)
Adds a GameModeArgument to the command with the given name.
- Returns:
The created GameModeArgument.
-
addGameProfileArgument
final GameProfileArgument addGameProfileArgument(String name)
Adds a GameProfileArgument to the command with the given name.
- Returns:
The created GameProfileArgument.
-
addDisplaySlotArgument
final DisplaySlotArgument addDisplaySlotArgument(String name)
Adds a DisplaySlotArgument to the command with the given name.
- Returns:
The created DisplaySlotArgument.
-
addObjectiveArgument
final ObjectiveArgument addObjectiveArgument(String name)
Adds an ObjectiveArgument to the command with the given name.
- Returns:
The created ObjectiveArgument.
-
addObjectiveCriteriaArgument
final ObjectiveCriteriaArgument addObjectiveCriteriaArgument(String name)
Adds an ObjectiveCriteriaArgument to the command with the given name.
- Returns:
The created ObjectiveCriteriaArgument.
-
addScoreHolderArgument
final ScoreHolderArgument addScoreHolderArgument(String name, ScoreHolderType type)
Adds a ScoreHolderArgument to the command with the given name.
- Parameters:
type
- The type of score holder.- Returns:
The created ScoreHolderArgument.
-
addTeamArgument
final TeamArgument addTeamArgument(String name)
Adds a TeamArgument to the command with the given name.
- Returns:
The created TeamArgument.
-
addLootTableArgument
final LootTableArgument addLootTableArgument(String name)
Adds a LootTableArgument to the command with the given name.
- Returns:
The created LootTableArgument.
-
addMirrorArgument
final MirrorArgument addMirrorArgument(String name)
Adds a MirrorArgument to the command with the given name.
- Returns:
The created MirrorArgument.
-
addStructureRotationArgument
final StructureRotationArgument addStructureRotationArgument(String name)
Adds a StructureRotationArgument to the command with the given name.
- Returns:
The created StructureRotationArgument.
-
addColorArgument
final ColorArgument addColorArgument(String name)
Adds a ColorArgument to the command with the given name.
- Returns:
The created ColorArgument.
-
addComponentArgument
final ComponentArgument addComponentArgument(String name)
Adds a ComponentArgument to the command with the given name.
- Returns:
The created ComponentArgument.
-
addMessageArgument
final MessageArgument addMessageArgument(String name)
Adds a MessageArgument to the command with the given name.
- Returns:
The created MessageArgument.
-
addStyleArgument
final StyleArgument addStyleArgument(String name)
Adds a StyleArgument to the command with the given name.
- Returns:
The created StyleArgument.
-
addEnvironmentArgument
final EnvironmentArgument addEnvironmentArgument(String name)
Adds an EnvironmentArgument to the command with the given name.
- Returns:
The created EnvironmentArgument.
-
addHeightMapArgument
final HeightMapArgument addHeightMapArgument(String name)
Adds a HeightMapArgument to the command with the given name.
- Returns:
The created HeightMapArgument.
-
addLocationArgument
final LocationArgument addLocationArgument(String name, LocationType type)
Adds a LocationArgument to the command with the given name.
- Parameters:
type
- The type of location.- Returns:
The created LocationArgument.
-
addParticleArgument
final ParticleArgument addParticleArgument(String name)
Adds a ParticleArgument to the command with the given name.
- Returns:
The created ParticleArgument.
-
-
-
-