Class EntitySelector
java.lang.Object
net.minecraft.commands.arguments.selector.EntitySelector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AABB
private static final EntityTypeTest
<Entity, ?> private final boolean
private final UUID
private final boolean
static final int
private final int
private final BiConsumer
<Vec3, List<? extends Entity>> static final BiConsumer
<Vec3, List<? extends Entity>> private final String
private final MinMaxBounds.Doubles
private final EntityTypeTest
<Entity, ?> private final boolean
private final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionEntitySelector
(int maxResults, boolean includesEntities, boolean worldLimited, List<Predicate<Entity>> contextFreePredicates, MinMaxBounds.Doubles range, Function<Vec3, Vec3> position, AABB aabb, BiConsumer<Vec3, List<? extends Entity>> order, boolean currentEntity, String playerName, UUID entityUUID, EntityType<?> type, boolean usesSelector) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addEntities
(List<Entity> entities, ServerLevel level, AABB box, Predicate<Entity> predicate) private void
checkPermissions
(CommandSourceStack source) findEntities
(CommandSourceStack source) findPlayers
(CommandSourceStack source) findSingleEntity
(CommandSourceStack source) findSinglePlayer
(CommandSourceStack source) private AABB
getAbsoluteAabb
(Vec3 pos) int
getPredicate
(Vec3 pos, AABB box, FeatureFlagSet enabledFeatures) private int
boolean
boolean
boolean
static Component
sortAndLimit
(Vec3 pos, List<T> entities) boolean
-
Field Details
-
INFINITE
public static final int INFINITE- See Also:
-
ORDER_ARBITRARY
-
ANY_TYPE
-
maxResults
private final int maxResults -
includesEntities
private final boolean includesEntities -
worldLimited
private final boolean worldLimited -
contextFreePredicates
-
range
-
position
-
aabb
-
order
-
currentEntity
private final boolean currentEntity -
playerName
-
entityUUID
-
type
-
usesSelector
private final boolean usesSelector
-
-
Constructor Details
-
EntitySelector
public EntitySelector(int maxResults, boolean includesEntities, boolean worldLimited, List<Predicate<Entity>> contextFreePredicates, MinMaxBounds.Doubles range, Function<Vec3, Vec3> position, @Nullable AABB aabb, BiConsumer<Vec3, List<? extends Entity>> order, boolean currentEntity, @Nullable String playerName, @Nullable UUID entityUUID, @Nullable EntityType<?> type, boolean usesSelector)
-
-
Method Details
-
getMaxResults
public int getMaxResults() -
includesEntities
public boolean includesEntities() -
isSelfSelector
public boolean isSelfSelector() -
isWorldLimited
public boolean isWorldLimited() -
usesSelector
public boolean usesSelector() -
checkPermissions
private void checkPermissions(CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findSingleEntity
public Entity findSingleEntity(CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findEntities
public List<? extends Entity> findEntities(CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
addEntities
-
getResultLimit
private int getResultLimit() -
findSinglePlayer
public ServerPlayer findSinglePlayer(CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findPlayers
public List<ServerPlayer> findPlayers(CommandSourceStack source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAbsoluteAabb
-
getPredicate
private Predicate<Entity> getPredicate(Vec3 pos, @Nullable AABB box, @Nullable FeatureFlagSet enabledFeatures) -
sortAndLimit
-
joinNames
-