Package net.minecraft.command.arguments
Class EntityArgument
- java.lang.Object
-
- net.minecraft.command.arguments.EntityArgument
-
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
public class EntityArgument extends java.lang.Object implements com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityArgument.Serializer
-
Field Summary
Fields Modifier and Type Field Description static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_NOT_SINGLE_ENTITY
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_NOT_SINGLE_PLAYER
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_ONLY_PLAYERS_ALLOWED
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_SELECTORS_NOT_ALLOWED
private static java.util.Collection<java.lang.String>
EXAMPLES
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
NO_ENTITIES_FOUND
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
NO_PLAYERS_FOUND
private boolean
playersOnly
private boolean
single
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityArgument(boolean p_i47969_1_, boolean p_i47969_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EntityArgument
entities()
static EntityArgument
entity()
static java.util.Collection<? extends Entity>
getEntities(com.mojang.brigadier.context.CommandContext<CommandSource> p_197097_0_, java.lang.String p_197097_1_)
static Entity
getEntity(com.mojang.brigadier.context.CommandContext<CommandSource> p_197088_0_, java.lang.String p_197088_1_)
java.util.Collection<java.lang.String>
getExamples()
static java.util.Collection<? extends Entity>
getOptionalEntities(com.mojang.brigadier.context.CommandContext<CommandSource> p_197087_0_, java.lang.String p_197087_1_)
static java.util.Collection<ServerPlayerEntity>
getOptionalPlayers(com.mojang.brigadier.context.CommandContext<CommandSource> p_201309_0_, java.lang.String p_201309_1_)
static ServerPlayerEntity
getPlayer(com.mojang.brigadier.context.CommandContext<CommandSource> p_197089_0_, java.lang.String p_197089_1_)
static java.util.Collection<ServerPlayerEntity>
getPlayers(com.mojang.brigadier.context.CommandContext<CommandSource> p_197090_0_, java.lang.String p_197090_1_)
<S> java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
listSuggestions(com.mojang.brigadier.context.CommandContext<S> p_listSuggestions_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_listSuggestions_2_)
EntitySelector
parse(com.mojang.brigadier.StringReader p_parse_1_)
static EntityArgument
player()
static EntityArgument
players()
-
-
-
Field Detail
-
EXAMPLES
private static final java.util.Collection<java.lang.String> 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
private final boolean single
-
playersOnly
private final boolean playersOnly
-
-
Method Detail
-
entity
public static EntityArgument entity()
-
getEntity
public static Entity getEntity(com.mojang.brigadier.context.CommandContext<CommandSource> p_197088_0_, java.lang.String p_197088_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
entities
public static EntityArgument entities()
-
getEntities
public static java.util.Collection<? extends Entity> getEntities(com.mojang.brigadier.context.CommandContext<CommandSource> p_197097_0_, java.lang.String p_197097_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getOptionalEntities
public static java.util.Collection<? extends Entity> getOptionalEntities(com.mojang.brigadier.context.CommandContext<CommandSource> p_197087_0_, java.lang.String p_197087_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getOptionalPlayers
public static java.util.Collection<ServerPlayerEntity> getOptionalPlayers(com.mojang.brigadier.context.CommandContext<CommandSource> p_201309_0_, java.lang.String p_201309_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
player
public static EntityArgument player()
-
getPlayer
public static ServerPlayerEntity getPlayer(com.mojang.brigadier.context.CommandContext<CommandSource> p_197089_0_, java.lang.String p_197089_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
players
public static EntityArgument players()
-
getPlayers
public static java.util.Collection<ServerPlayerEntity> getPlayers(com.mojang.brigadier.context.CommandContext<CommandSource> p_197090_0_, java.lang.String p_197090_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public EntitySelector parse(com.mojang.brigadier.StringReader p_parse_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Specified by:
parse
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> p_listSuggestions_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_listSuggestions_2_)
- Specified by:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
getExamples
public java.util.Collection<java.lang.String> getExamples()
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
-