Package net.minecraft.commands.arguments
Class EntityArgument
java.lang.Object
net.minecraft.commands.arguments.EntityArgument
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
public class EntityArgument
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private static final Collection
<String> static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
(package private) final boolean
(package private) final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityArgument
entities()
static EntityArgument
entity()
static Collection
<? extends Entity> getEntities
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) static Entity
getEntity
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) static Collection
<? extends Entity> getOptionalEntities
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) static Collection
<ServerPlayer> getOptionalPlayers
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) static ServerPlayer
getPlayer
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) static Collection
<ServerPlayer> getPlayers
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) <S> CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> listSuggestions
(com.mojang.brigadier.context.CommandContext<S> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) parse
(com.mojang.brigadier.StringReader pReader) private EntitySelector
parse
(com.mojang.brigadier.StringReader pReader, boolean pAllowSelectors) <S> EntitySelector
parse
(com.mojang.brigadier.StringReader pReader, S p_353120_) static EntityArgument
player()
static EntityArgument
players()
-
Field Details
-
EXAMPLES
-
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 -
ERROR_SELECTORS_NOT_ALLOWED
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_SELECTORS_NOT_ALLOWED -
single
final boolean single -
playersOnly
final boolean playersOnly
-
-
Constructor Details
-
EntityArgument
protected EntityArgument(boolean pSingle, boolean pPlayersOnly)
-
-
Method Details
-
entity
-
getEntity
public static Entity getEntity(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
entities
-
getEntities
public static Collection<? extends Entity> getEntities(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getOptionalEntities
public static Collection<? extends Entity> getOptionalEntities(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getOptionalPlayers
public static Collection<ServerPlayer> getOptionalPlayers(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
player
-
getPlayer
public static ServerPlayer getPlayer(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
players
-
getPlayers
public static Collection<ServerPlayer> getPlayers(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public EntitySelector parse(com.mojang.brigadier.StringReader pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public <S> EntitySelector parse(com.mojang.brigadier.StringReader pReader, S p_353120_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parse
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
private EntitySelector parse(com.mojang.brigadier.StringReader pReader, boolean pAllowSelectors) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) - Specified by:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-