Okay, so I created an player sort of object so I can get the players kills and stuff, but if I call it like this PlayerObject player = new PlayerObject(player); it will reset the kills every time. Does anyone know how I can call this object without resetting the kills and stuff?
You shouldn't be making a new PlayerObject every time you want to call it. I would recommend that you do something similar to Bukkit.getPlayer() and save all of the PlayerObjects in a List and access them whenever you need it. You may already know this too but you have to save all of the kills in a data/config or MySQL database because it won't be stored when the server reboots.
Mattredsox I don't want my kills to be saved, but I want to be able to check the players kills for a round and then I want the kills to reset after a round end(This is for a mini-game).
Then all you will need to do is save all of the PlayerObjects that you make in a List and access the PlayerObject from that list when you need it. If you need an example with code I would be willing to code something up for you quickly.
Mattredsox An example code would be nice I am still getting the hang of creating objects and using them.
Here is some code for you to work off of: Code:java List<PlayerObject> playerObjects = new ArrayList<PlayerObject>(); public void createPlayer(Player player) { PlayerObject playerObj = new PlayerObject(player); playerObjects.add(playerObj); } public PlayerObject getPlayerObject(Player player) { for (PlayerObject playerObj : playerObjects) { if (playerObj.getPlayer().getName() == player.getName()) { return playerObj; } } }