Package net.minecraft.world
Interface EntityView
- All Known Subinterfaces:
class_5423
,ServerWorldAccess
,StructureWorldAccess
,WorldAccess
- All Known Implementing Classes:
ChunkRegion
,ClientWorld
,ServerWorld
,World
public interface EntityView
-
Method Summary
Modifier and Type Method Description default <T extends LivingEntity>
TgetClosestEntity(Class<? extends T> entityClass, TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z, Box box)
default <T extends LivingEntity>
TgetClosestEntity(List<? extends T> entityList, TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z)
default <T extends LivingEntity>
TgetClosestEntityIncludingUngeneratedChunks(Class<? extends T> entityClass, TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z, Box box)
default PlayerEntity
getClosestPlayer(double x, double y, double z, double maxDistance, boolean ignoreCreative)
default PlayerEntity
getClosestPlayer(double x, double y, double z, double maxDistance, Predicate<Entity> targetPredicate)
default PlayerEntity
getClosestPlayer(TargetPredicate targetPredicate, double x, double y, double z)
default PlayerEntity
getClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity)
default PlayerEntity
getClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z)
default PlayerEntity
getClosestPlayer(Entity entity, double maxDistance)
<T extends Entity>
List<T>getEntitiesByClass(Class<? extends T> entityClass, Box box, Predicate<? super T> predicate)
Computes a list of entities within some box whose runtime Java class is the same as or is a subclass of the given class.default <T extends Entity>
List<T>getEntitiesIncludingUngeneratedChunks(Class<? extends T> entityClass, Box box)
default <T extends Entity>
List<T>getEntitiesIncludingUngeneratedChunks(Class<? extends T> entityClass, Box box, Predicate<? super T> predicate)
default Stream<VoxelShape>
getEntityCollisions(Entity entity, Box box, Predicate<Entity> predicate)
default <T extends Entity>
List<T>getNonSpectatingEntities(Class<? extends T> entityClass, Box box)
default List<Entity>
getOtherEntities(Entity except, Box box)
Computes a list of entities within some box, excluding the given entity, that are not spectators.List<Entity>
getOtherEntities(Entity except, Box box, Predicate<? super Entity> predicate)
Computes a list of entities within some box, excluding the given entity, that satisfy the given predicate.default PlayerEntity
getPlayerByUuid(UUID uuid)
List<? extends PlayerEntity>
getPlayers()
default List<PlayerEntity>
getPlayers(TargetPredicate targetPredicate, LivingEntity entity, Box box)
default <T extends LivingEntity>
List<T>getTargets(Class<? extends T> entityClass, TargetPredicate targetPredicate, LivingEntity targetingEntity, Box box)
default boolean
intersectsEntities(Entity entity, VoxelShape shape)
default boolean
isPlayerInRange(double x, double y, double z, double range)
-
Method Details
-
getOtherEntities
List<Entity> getOtherEntities(@Nullable Entity except, Box box, @Nullable Predicate<? super Entity> predicate)Computes a list of entities within some box, excluding the given entity, that satisfy the given predicate.- Parameters:
except
- the entity the box logically surrounds. This entity is ignored if it is inside the box.box
- the box in which to search for entitiespredicate
- a predicate which entities must satisfy in order to be included in the returned list.- Returns:
- a list of entities within a box, excluding the given entity, all satisfying the given predicate
-
getEntitiesByClass
<T extends Entity> List<T> getEntitiesByClass(Class<? extends T> entityClass, Box box, @Nullable Predicate<? super T> predicate)Computes a list of entities within some box whose runtime Java class is the same as or is a subclass of the given class.- Parameters:
entityClass
- the class the list of entities must extendbox
- the box in which to search for entitiespredicate
- a predicate which entities must satisfy in order to be included in the returned list- Returns:
- a list of entities within the box whose runtime class is a subclass of the given class
-
getEntitiesIncludingUngeneratedChunks
-
getPlayers
List<? extends PlayerEntity> getPlayers() -
getOtherEntities
Computes a list of entities within some box, excluding the given entity, that are not spectators.- Parameters:
except
- the entity the box logically surrounds. This entity is ignored if it is inside the box.box
- the box in which to search for entities- Returns:
- a list of entities within a box, excluding the given entity
- See Also:
#getSurroundingEntities(Entity, Box, Predicate)
,Entity.isSpectator()
-
intersectsEntities
-
getNonSpectatingEntities
-
getEntitiesIncludingUngeneratedChunks
-
getEntityCollisions
-
getClosestPlayer
@Nullable default PlayerEntity getClosestPlayer(double x, double y, double z, double maxDistance, @Nullable Predicate<Entity> targetPredicate) -
getClosestPlayer
-
getClosestPlayer
@Nullable default PlayerEntity getClosestPlayer(double x, double y, double z, double maxDistance, boolean ignoreCreative) -
isPlayerInRange
default boolean isPlayerInRange(double x, double y, double z, double range) -
getClosestPlayer
@Nullable default PlayerEntity getClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity) -
getClosestPlayer
@Nullable default PlayerEntity getClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z) -
getClosestPlayer
@Nullable default PlayerEntity getClosestPlayer(TargetPredicate targetPredicate, double x, double y, double z) -
getClosestEntity
@Nullable default <T extends LivingEntity> T getClosestEntity(Class<? extends T> entityClass, TargetPredicate targetPredicate, @Nullable LivingEntity entity, double x, double y, double z, Box box) -
getClosestEntityIncludingUngeneratedChunks
@Nullable default <T extends LivingEntity> T getClosestEntityIncludingUngeneratedChunks(Class<? extends T> entityClass, TargetPredicate targetPredicate, @Nullable LivingEntity entity, double x, double y, double z, Box box) -
getClosestEntity
@Nullable default <T extends LivingEntity> T getClosestEntity(List<? extends T> entityList, TargetPredicate targetPredicate, @Nullable LivingEntity entity, double x, double y, double z) -
getPlayers
default List<PlayerEntity> getPlayers(TargetPredicate targetPredicate, LivingEntity entity, Box box) -
getTargets
default <T extends LivingEntity> List<T> getTargets(Class<? extends T> entityClass, TargetPredicate targetPredicate, LivingEntity targetingEntity, Box box) -
getPlayerByUuid
-