for (Player p : Bukkit.getOnlinePlayers()) {
tmapi.sendTitles(p, "§aЗелёная команда", "§aпобедила!");
p.setGameMode(GameMode.SPECTATOR);
Block block = world.getBlockAt(71, 80, 66);
block.setType(Material.STRUCTURE_BLOCK, false);
BlockPosition pos = new BlockPosition(block.getX(), block.getY(), block.getZ());
TileEntityStructure structure = (TileEntityStructure)((CraftPlayer)p).getHandle().world.getTileEntity(pos);
structure.a(createNBTstructure("GreenPegasus", 71, 80, 66, 31, 17, 23, -15, 0, 0));
world.getBlockAt(71, 81, 66).setType(Material.REDSTONE_BLOCK);
}
/* Метод createNBTstructure */
public static NBTTagCompound createNBTstructure(String name, int x1, int y1, int z1, int x2, int y2, int z2, int posx, int posy, int posz) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("id", "Structure");
nbttagcompound.setInt("x", x1);
nbttagcompound.setInt("y", y1);
nbttagcompound.setInt("z", z1);
nbttagcompound.setString("name", name);
nbttagcompound.setString("author", "XjCyan1de");
nbttagcompound.setString("metadata", "");
nbttagcompound.setInt("posX", posx);
nbttagcompound.setInt("posY", posy);
nbttagcompound.setInt("posZ", posz);
nbttagcompound.setInt("sizeX", x2);
nbttagcompound.setInt("sizeY", y2);
nbttagcompound.setInt("sizeZ", z2);
nbttagcompound.setString("rotation", "NONE");
nbttagcompound.setString("mirror", "NONE");
nbttagcompound.setString("mode", "LOAD");
nbttagcompound.setByte("ignoreEntities", (byte) 1);
nbttagcompound.setBoolean("powered", false);
nbttagcompound.setBoolean("showair", false);
nbttagcompound.setBoolean("showboundingbox", true);
nbttagcompound.setFloat("integrity", 1.0f);
nbttagcompound.setLong("seed", 0);
return nbttagcompound;
}