Scoreboard Teams

Discussion in 'Plugin Development' started by VortexGG, Apr 23, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    VortexGG

    I want to do scoreboard team for all joined players with options: seeFriendlyInvisibles

    But plugin doesnt creating Team "Fix"!!!

    Code:
    Code:
    package me.vortexgg.invisfix;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scoreboard.ScoreboardManager;
    import org.bukkit.scoreboard.Team;
    import org.bukkit.scoreboard.NameTagVisibility;
    import org.bukkit.scoreboard.Scoreboard;
    
    
    public final class Main extends JavaPlugin implements Listener {
    
    private Scoreboard board;
    
    @Override
    public void onEnable() {
    Bukkit.getServer().getPluginManager().registerEvents(this, this);
    board = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
    Team team = board.registerNewTeam("Fix");
    team.setCanSeeFriendlyInvisibles(true)
    }
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
    Player p = e.getPlayer();
    p.setScoreboard(board);
    
    }
    }
     
    Last edited by a moderator: Apr 23, 2020
Thread Status:
Not open for further replies.

Share This Page