Hi! so I want to create a Spectator Gui, so when they die they can open a gui with all the players online and they can tp to them. so how do i do that? plz help
Hey there RoBaMe, I am guessing you do not have much experience with java. Here is a video teaching you how to do this: But before you do this, I recommend watching some tutorials on bukkit 1.8 coding by sk3tch to get a good idea on what to do, here: https://www.youtube.com/playlist?list=PLN-Lu6PBXd53x00NwMGbfWwIig_CIOGm8
@Proffesor_Diggi I Know how to make Gui's but I need to make a Gui with all the players that online, that is the part that i'm asking about.
Code: public Inventory SpectatorInv() { Inventory inv = Bukkit.createInventory(null, 36, "Spectators"); for (Player online : Bukkit.getOnlinePlayers()) { ItemStack item = new ItemStack(Material.SKULL_ITEM, 1); SkullMeta meta = (SkullMeta) item.getItemMeta(); meta.setOwner(online.getName()); meta.setDisplayName(online.getName()); meta.setLore(Arrays.asList("Click to teleport to player", online.getName())); item.setItemMeta(meta); inv.addItem(item); } return inv; } @SuppressWarnings("deprecation") @EventHandler public void onInventoryClick(InventoryClickEvent e) { if (!(e.getInventory().getTitle().equals("Spectators"))) { return; } e.setCancelled(true); e.getWhoClicked().teleport( Bukkit.getPlayer(e.getCurrentItem().getItemMeta() .getDisplayName())); } Something like this, but this creates a new inventory every time you call SpectatorInv, you can also create one inventory for everybody in onEnable and then update that every x seconds using a scheduler