Java Code Examples for net.minecraft.world.World.getClosestPlayer()

The following are Jave code examples for showing how to use getClosestPlayer() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: harshencastle   File: HarshenUtils.java   Source Code and License Vote up 4 votes
public static EntityPlayer getClosestPlayer(World world, BlockPos position)
{
	return world.getClosestPlayer(position.getX(), position.getY(), position.getZ(), Integer.MAX_VALUE, false);
}
 
Example 2
Project: Solar   File: BlockSchrodingerGlyph.java   Source Code and License Vote up 4 votes
private Optional<EntityPlayer> getClosestPlayer(World world, BlockPos pos) {
	EntityPlayer player = world.getClosestPlayer(pos.getX(), pos.getY(), pos.getZ(), 10, false);
	return Optional.ofNullable(player);
}