int radius = 5;
final Block block = event.getBlock(); //placed block
for (int x = -(radius); x <= radius; x ++)
{
for (int y = -(radius); y <= radius; y ++)
{
for (int z = -(radius); z <= radius; z ++)
{
if (block.getRelative(x,y,z).getType() == Material.STONE_PLATE)
{
event.setCancelled(true);
p.sendMessage(ChatColor.RED + "You cannot place a plate trap within five blocks of other plate traps!");
}
}
}
}
Pergunta
TequilAxBr
Seguinte, estou criando um plugin para stackar spawners, só que to tentando pegar os blocos em volta de um bloco colocado, e não tá dando certo kk...
Quero fazer tipo o método getNerbyEntities(x,y,z); da class Entity.
Estou tentando fazer assim: https://bukkit.org/threads/find-block-in-radius.88298/
Código:
Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados