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 classEntityArgumentType.Serializer -
Field Summary
Fields Modifier and Type Field Description static com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeENTITY_NOT_FOUND_EXCEPTIONprivate static Collection<String>EXAMPLESstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeNOT_ALLOWED_EXCEPTIONstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypePLAYER_NOT_FOUND_EXCEPTIONstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypePLAYER_SELECTOR_HAS_ENTITIES_EXCEPTIONprivate booleanplayersOnlyprivate booleansingleTargetstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeTOO_MANY_ENTITIES_EXCEPTIONstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeTOO_MANY_PLAYERS_EXCEPTION -
Constructor Summary
Constructors Modifier Constructor Description protectedEntityArgumentType(boolean singleTarget, boolean playersOnly) -
Method Summary
Modifier and Type Method Description static EntityArgumentTypeentities()static EntityArgumentTypeentity()static Collection<? extends Entity>getEntities(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, String name)static EntitygetEntity(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 ServerPlayerEntitygetPlayer(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)EntitySelectorparse(com.mojang.brigadier.StringReader stringReader)static EntityArgumentTypeplayer()static EntityArgumentTypeplayers()
-
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:
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>
-
getExamples
- Specified by:
getExamplesin interfacecom.mojang.brigadier.arguments.ArgumentType<EntitySelector>
-