Class EntitySelector
java.lang.Object
net.minecraft.commands.arguments.selector.EntitySelector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AABBprivate static final EntityTypeTest<Entity, ?> private final booleanprivate final UUIDprivate final booleanstatic final intprivate final intprivate final BiConsumer<Vec3, List<? extends Entity>> static final BiConsumer<Vec3, List<? extends Entity>> private final Stringprivate final MinMaxBounds.Doublesprivate final EntityTypeTest<Entity, ?> private final booleanprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionEntitySelector(int pMaxResults, boolean pIncludesEntities, boolean pWorldLimited, List<Predicate<Entity>> pContextFreePredicates, MinMaxBounds.Doubles pRange, Function<Vec3, Vec3> pPosition, AABB pAabb, BiConsumer<Vec3, List<? extends Entity>> pOrder, boolean pCurrentEntity, String pPlayerName, UUID pEntityUUID, EntityType<?> pType, boolean pUsesSelector) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddEntities(List<Entity> pEntities, ServerLevel pLevel, AABB pBox, Predicate<Entity> pPredicate) private voidcheckPermissions(CommandSourceStack pSource) findEntities(CommandSourceStack pSource) findPlayers(CommandSourceStack pSource) findSingleEntity(CommandSourceStack pSource) findSinglePlayer(CommandSourceStack pSource) private AABBgetAbsoluteAabb(Vec3 pPos) intgetPredicate(Vec3 pPos, AABB pBox, FeatureFlagSet pEnabledFeatures) private intbooleanbooleanbooleanstatic ComponentsortAndLimit(Vec3 pPos, List<T> pEntities) 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 pMaxResults, boolean pIncludesEntities, boolean pWorldLimited, List<Predicate<Entity>> pContextFreePredicates, MinMaxBounds.Doubles pRange, Function<Vec3, Vec3> pPosition, @Nullable AABB pAabb, BiConsumer<Vec3, List<? extends Entity>> pOrder, boolean pCurrentEntity, @Nullable String pPlayerName, @Nullable UUID pEntityUUID, @Nullable EntityType<?> pType, boolean pUsesSelector)
-
-
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 pSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findSingleEntity
public Entity findSingleEntity(CommandSourceStack pSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findEntities
public List<? extends Entity> findEntities(CommandSourceStack pSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
addEntities
-
getResultLimit
private int getResultLimit() -
findSinglePlayer
public ServerPlayer findSinglePlayer(CommandSourceStack pSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
findPlayers
public List<ServerPlayer> findPlayers(CommandSourceStack pSource) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAbsoluteAabb
-
getPredicate
private Predicate<Entity> getPredicate(Vec3 pPos, @Nullable AABB pBox, @Nullable FeatureFlagSet pEnabledFeatures) -
sortAndLimit
-
joinNames
-