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 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 void
addEntities
(List<Entity> pEntities, ServerLevel pLevel, AABB pBox, Predicate<Entity> pPredicate) private void
checkPermissions
(CommandSourceStack pSource) findEntities
(CommandSourceStack pSource) findPlayers
(CommandSourceStack pSource) findSingleEntity
(CommandSourceStack pSource) findSinglePlayer
(CommandSourceStack pSource) private AABB
getAbsoluteAabb
(Vec3 pPos) int
getPredicate
(Vec3 pPos, AABB pBox, FeatureFlagSet pEnabledFeatures) private int
boolean
boolean
boolean
static Component
sortAndLimit
(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
-