Package dev.jorel.commandapi.arguments
Record Class EntitySelectorArgumentType
java.lang.Object
java.lang.Record
dev.jorel.commandapi.arguments.EntitySelectorArgumentType
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
public record EntitySelectorArgumentType(boolean singleTarget, boolean playersOnly)
extends Record
implements com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionType -
Constructor Summary
ConstructorsConstructorDescriptionEntitySelectorArgumentType(boolean singleTarget, boolean playersOnly) Creates an instance of aEntitySelectorArgumentTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySelectorArgumentTypeentities()static EntitySelectorArgumentTypeentity()final booleanIndicates whether some other object is "equal to" this one.static List<? extends org.bukkit.entity.Entity> findManyEntities(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key, boolean allowEmpty) static List<org.bukkit.entity.Player> findManyPlayers(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key, boolean allowEmpty) static org.bukkit.entity.EntityfindSingleEntity(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key) static org.bukkit.entity.PlayerfindSinglePlayer(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key) final inthashCode()Returns a hash code value for this object.<S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) parse(com.mojang.brigadier.StringReader reader) static EntitySelectorArgumentTypeplayer()static EntitySelectorArgumentTypeplayers()booleanReturns the value of theplayersOnlyrecord component.booleanReturns the value of thesingleTargetrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.mojang.brigadier.arguments.ArgumentType
getExamples
-
Field Details
-
ERROR_NOT_SINGLE_ENTITY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_SINGLE_ENTITY -
ERROR_NOT_SINGLE_PLAYER
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_SINGLE_PLAYER -
ERROR_ONLY_PLAYERS_ALLOWED
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_ONLY_PLAYERS_ALLOWED -
NO_ENTITIES_FOUND
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType NO_ENTITIES_FOUND -
NO_PLAYERS_FOUND
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType NO_PLAYERS_FOUND
-
-
Constructor Details
-
EntitySelectorArgumentType
public EntitySelectorArgumentType(boolean singleTarget, boolean playersOnly) Creates an instance of aEntitySelectorArgumentTyperecord class.- Parameters:
singleTarget- the value for thesingleTargetrecord componentplayersOnly- the value for theplayersOnlyrecord component
-
-
Method Details
-
entities
-
players
-
entity
-
player
-
parse
public EntitySelector parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parsein interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) - Specified by:
listSuggestionsin interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
findManyEntities
public static List<? extends org.bukkit.entity.Entity> findManyEntities(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key, boolean allowEmpty) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findManyPlayers
public static List<org.bukkit.entity.Player> findManyPlayers(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key, boolean allowEmpty) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findSingleEntity
public static org.bukkit.entity.Entity findSingleEntity(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findSinglePlayer
public static org.bukkit.entity.Player findSinglePlayer(com.mojang.brigadier.context.CommandContext<MockCommandSource> cmdCtx, String key) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
singleTarget
public boolean singleTarget()Returns the value of thesingleTargetrecord component.- Returns:
- the value of the
singleTargetrecord component
-
playersOnly
public boolean playersOnly()Returns the value of theplayersOnlyrecord component.- Returns:
- the value of the
playersOnlyrecord component
-