PlayerLookup

public final class PlayerLookup

For example, a block entity may use the methods in this class to send a packet to all clients which can see the block entity in order notify clients about a change.

The word "tracking" means that an entity/chunk on the server is known to a player's client (within in view distance) and the (block) entity should notify tracking clients of changes.

These methods should only be called on the server thread and only be used on logical a server.

Functions

all
Link copied to clipboard
static Collection<ServerPlayerEntityall(MinecraftServer server)
Gets all the players on the minecraft server.
around
Link copied to clipboard
static Collection<ServerPlayerEntityaround(ServerWorld world, Vec3d pos, double radius)
Gets all players around a position in a world.
static Collection<ServerPlayerEntityaround(ServerWorld world, Vec3i pos, double radius)
Gets all players around a position in a world.
tracking
Link copied to clipboard
static Collection<ServerPlayerEntitytracking(BlockEntity blockEntity)
Gets all players tracking a block entity in a server world.
static Collection<ServerPlayerEntitytracking(Entity entity)
Gets all players tracking an entity in a server world.
static Collection<ServerPlayerEntitytracking(ServerWorld world, BlockPos pos)
Gets all players tracking a block position in a server world.
static Collection<ServerPlayerEntitytracking(ServerWorld world, ChunkPos pos)
Gets all players tracking a chunk in a server world.
world
Link copied to clipboard
static Collection<ServerPlayerEntityworld(ServerWorld world)
Gets all the players in a server world.

Sources

jvm source
Link copied to clipboard