hi does anyone know a simple team plugin with a source code that i could look at as im struggling to create the team part of a team based game plugin with 2 teams. i learn by looking at code and cannot find a simple plugin so i can look at code and understand it
I am also trying to create the same thing but I have learned that asking people for code does not help you to learn. You will just copy and paste and will never learn. I recommend you do the same as what I have been doing for the past couple of days which is to watch tutorials on youtube on java and then you will have no trouble as I can tell you are not very experienced (Like myself) at coding.
thats the thing i really dont just copy and paste everything ive learned so far is by back tracking different plugins and understanding snipets i can not find any tutorials about team apart from scoreboards but i dont want a scoreboard just 2 teams. i will even make my code open source so everyone can see. i currently have no code just a to-do list as its all building on the main part what is the teams without that i can not do the rest .
ArrayList<String> TEAM_BLUE = new ArrayList<String>(); ArrayList<String> TEAM_RED = new ArrayList<String>(); etc, add players to teams like so TEAM_RED.add(event.getPlayer().getName());
this is not my thread, but I was wondering, is it possible to remove this arrayList when you wont need it anymore?
bennie3211 Remove the whole array list or just a player? If its just a player, then: Code: (ArrayListName).remove(event.getPlayer().getName()); (I think) If you want to remove all the players, then: Code: (ArrayListName).removeAll(ArrayListName); So: [CODE:JAVA]TEAM_RED.removeAll(TEAM_RED); //or TEAM_RED.remove(event.getPlayer().getName()):[/CODE] That is what I think you would do, don't have a great experience with Array Lists so it could be wrong.