Team Bug(NeedHelp)

Discussion in 'Plugin Development' started by Rick221, Jan 17, 2015.

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

    Rick221

    This is the first time I have tried creating a MiniGame, I am having a little trouble with Teams. I want to have a team that players cant join, as this will be the team that is attacking the players (its a survival MiniGame where waves of pigs attack you) I havn't tried something like this before so I am trying to figure out what to do. My code is below, please tell me what I am doing wrong


    Code:
    package me.rick221133.handlers;
    
    import me.rick221133.utils.LocationUtilities;
    
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.entity.Player;
    
    public class Game {
        private static boolean canStart = false;
        private static boolean hasStarted = false;
        public static boolean canStart() {
            return canStart;
        }
        public static void setCanStart(boolean b) {
            canStart = b;
        
        }
    
          public static void start() {
              hasStarted = true;
                new Team("Player", new Location(Bukkit.getWorld("world"), 20, 64, 20));
                new Team("Pig", new Location(Bukkit.getWorld("world"), 20, 64, 20));
                int i = 0;
                for(Player player : Bukkit.getOnlinePlayers()) {
                    if(i > Team.getAllTeams().size())
                        i = 0;
                    Team.getTeam(Team.getAllTeams().get(i++).getName()).add(player);
                    LocationUtilities.teleportToGame(player, Team.getAllTeams().get(i));
                    i++;
            
                }
            
        
                
                }
                        
                        
                    
            
        
      
          public static void stop() {
              hasStarted = false;
          
          }
      
          public static boolean hasStarted() {
              return hasStarted;
          
          }
          public static boolean canJoinTeam() {
              return canJoinTeam();
            return canJoinTeam = false;
        
          }
        
    
    }
     
    Last edited: Jan 17, 2015
  2. Offline

    SuperOriginal

    Insert your code into code tags with proper indentation, and give your exact problems.
     
Thread Status:
Not open for further replies.

Share This Page