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 PlayerEntitygetClosestPlayer(double x, double y, double z, double maxDistance, boolean ignoreCreative)default PlayerEntitygetClosestPlayer(double x, double y, double z, double maxDistance, Predicate<Entity> targetPredicate)default PlayerEntitygetClosestPlayer(TargetPredicate targetPredicate, double x, double y, double z)default PlayerEntitygetClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity)default PlayerEntitygetClosestPlayer(TargetPredicate targetPredicate, LivingEntity entity, double x, double y, double z)default PlayerEntitygetClosestPlayer(Entity entity, double maxDistance)default <T extends Entity>
List<T>getEntitiesByClass(Class<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.<T extends Entity>
List<T>getEntitiesByType(class_5575<Entity,T> class_5575, 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<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 PlayerEntitygetPlayerByUuid(UUID uuid)List<? extends PlayerEntity>getPlayers()default List<PlayerEntity>getPlayers(TargetPredicate targetPredicate, LivingEntity entity, Box box)default <T extends LivingEntity>
List<T>getTargets(Class<T> entityClass, TargetPredicate targetPredicate, LivingEntity targetingEntity, Box box)default booleanintersectsEntities(Entity entity, VoxelShape shape)default booleanisPlayerInRange(double x, double y, double z, double range)
-
Method Details
-
getOtherEntities
List<Entity> getOtherEntities(@Nullable 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.- 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
-
getEntitiesByType
-
getEntitiesByClass
default <T extends Entity> List<T> getEntitiesByClass(Class<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.- 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
-
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:
getOtherEntities(Entity, Box, Predicate),Entity.isSpectator()
-
intersectsEntities
-
getNonSpectatingEntities
-
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) -
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<T> entityClass, TargetPredicate targetPredicate, LivingEntity targetingEntity, Box box) -
getPlayerByUuid
-