Location spawnLocation = new Location(world, 0, 64, 0); int spawnY = spawnLocation.getBlockY();
Player player = Bukkit.getPlayer("SomePlayer"); Location playerLocation = player.getLocation(); int playerY = playerLocation.getBlockY();In this example, we retrieve the Location of a player in the game world, then call the getBlockY method on this Location to retrieve the Y coordinate of the block above the player. This could be used for various purposes, such as checking if the player is standing on a certain type of block. This method is part of the Bukkit API, which is a Java library for developing plugins for the popular game Minecraft.