Package net.minecraft.command.argument
Class EntityArgumentType
java.lang.Object
net.minecraft.command.argument.EntityArgumentType
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
public class EntityArgumentType extends Object implements com.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityArgumentType.Serializer
-
Field Summary
Fields Modifier and Type Field Description static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ENTITY_NOT_FOUND_EXCEPTION
private static Collection<String>
EXAMPLES
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
NOT_ALLOWED_EXCEPTION
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
PLAYER_NOT_FOUND_EXCEPTION
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
PLAYER_SELECTOR_HAS_ENTITIES_EXCEPTION
private boolean
playersOnly
private boolean
singleTarget
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
TOO_MANY_ENTITIES_EXCEPTION
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
TOO_MANY_PLAYERS_EXCEPTION
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityArgumentType(boolean singleTarget, boolean playersOnly)
-
Method Summary
Modifier and Type Method Description static EntityArgumentType
entities()
static EntityArgumentType
entity()
static Collection<? extends Entity>
getEntities(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name)
static Entity
getEntity(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name)
Collection<String>
getExamples()
static Collection<? extends Entity>
getOptionalEntities(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string)
static Collection<ServerPlayerEntity>
getOptionalPlayers(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string)
static ServerPlayerEntity
getPlayer(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string)
static Collection<ServerPlayerEntity>
getPlayers(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string)
<S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
EntitySelector
parse(com.mojang.brigadier.StringReader stringReader)
static EntityArgumentType
player()
static EntityArgumentType
players()
-
Field Details
-
EXAMPLES
-
TOO_MANY_ENTITIES_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType TOO_MANY_ENTITIES_EXCEPTION -
TOO_MANY_PLAYERS_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType TOO_MANY_PLAYERS_EXCEPTION -
PLAYER_SELECTOR_HAS_ENTITIES_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType PLAYER_SELECTOR_HAS_ENTITIES_EXCEPTION -
ENTITY_NOT_FOUND_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ENTITY_NOT_FOUND_EXCEPTION -
PLAYER_NOT_FOUND_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType PLAYER_NOT_FOUND_EXCEPTION -
NOT_ALLOWED_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType NOT_ALLOWED_EXCEPTION -
singleTarget
private final boolean singleTarget -
playersOnly
private final boolean playersOnly
-
-
Constructor Details
-
EntityArgumentType
protected EntityArgumentType(boolean singleTarget, boolean playersOnly)
-
-
Method Details
-
entity
-
getEntity
public static Entity getEntity(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name) -
entities
-
getEntities
public static Collection<? extends Entity> getEntities(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name) -
getOptionalEntities
public static Collection<? extends Entity> getOptionalEntities(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string) -
getOptionalPlayers
public static Collection<ServerPlayerEntity> getOptionalPlayers(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string) -
player
-
getPlayer
public static ServerPlayerEntity getPlayer(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string) -
players
-
getPlayers
public static Collection<ServerPlayerEntity> getPlayers(com.mojang.brigadier.context.CommandContext<ServerCommandSource> commandContext, String string) -
parse
public EntitySelector parse(com.mojang.brigadier.StringReader stringReader) 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> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)- Specified by:
listSuggestions
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-
getExamples
- Specified by:
getExamples
in interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-