Location loc = new Location(world, x, y, z); Block block = loc.getBlock(); Material material = block.getType();
Location loc = new Location(world, x, y, z); Block block = loc.getBlock(); block.setType(Material.STONE);This code creates a new Location object and retrieves the block at that location. It then sets the Material type of the block to STONE. Package library: org.bukkit.