Class EntitySelector
java.lang.Object
net.minecraft.commands.arguments.selector.EntitySelector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable AABBprivate static final EntityTypeTest<Entity, ?> private final booleanprivate final @Nullable UUIDprivate final booleanstatic final intprivate final intprivate final BiConsumer<Vec3, List<? extends Entity>> static final BiConsumer<Vec3, List<? extends Entity>> private final @Nullable Stringprivate final @Nullable MinMaxBounds.Doublesprivate final EntityTypeTest<Entity, ?> private final booleanprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionEntitySelector(int maxResults, boolean includesEntities, boolean worldLimited, List<Predicate<Entity>> contextFreePredicates, @Nullable 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 Summary
Modifier and TypeMethodDescriptionprivate voidaddEntities(List<Entity> result, ServerLevel level, @Nullable AABB absoluteAABB, Predicate<Entity> predicate) private voidcheckPermissions(CommandSourceStack sender) findEntities(CommandSourceStack sender) findPlayers(CommandSourceStack sender) findSingleEntity(CommandSourceStack sender) findSinglePlayer(CommandSourceStack sender) private @Nullable AABBgetAbsoluteAabb(Vec3 pos) intgetPredicate(Vec3 pos, @Nullable AABB absoluteAabb, @Nullable FeatureFlagSet enabledFeatures) private intbooleanbooleanbooleanstatic ComponentsortAndLimit(Vec3 pos, List<T> result) 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, @Nullable 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 sender) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findSingleEntity
public Entity findSingleEntity(CommandSourceStack sender) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findEntities
public List<? extends Entity> findEntities(CommandSourceStack sender) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
addEntities
-
getResultLimit
private int getResultLimit() -
findSinglePlayer
public ServerPlayer findSinglePlayer(CommandSourceStack sender) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findPlayers
public List<ServerPlayer> findPlayers(CommandSourceStack sender) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAbsoluteAabb
-
getPredicate
private Predicate<Entity> getPredicate(Vec3 pos, @Nullable AABB absoluteAabb, @Nullable FeatureFlagSet enabledFeatures) -
sortAndLimit
-
joinNames
-