- Баллы
- 103
Есть такой код - он спавнит алмазные блоки вокруг игрока:
Собственно вопрос в теме. Нужно опустить всю поверхность, а не одну сторону.
Код:
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
Player player = (Player) sender;
Location location = player.getLocation();
if (command.getName().equalsIgnoreCase("start"))
{
for (int x = location.getBlockX() + 10; x >= location.getBlockX() - 10; x--)
{
for (int z = location.getBlockZ() + 10; z >= location.getBlockZ() - 10; z--)
{
while (location.getWorld().getBlockAt(x, location.getBlockY(), z).getType() != Material.AIR)
{
location.setY(location.getBlockY() + 1);
}
location.getWorld().getBlockAt(x, location.getBlockY(), z).setType(Material.DIAMOND_BLOCK);
}
}
}
}
Последнее редактирование: