Hi guys i have problem i use hashmap <player,double> and show money from player but i have that problem When have more one player online scoreboard show money all the players not specific player ( sorry my english) On image show 2 values ( 2 players ) Player 1 $48.3 Player 2 $26.2 i try this i use other hashmap writing last_coins off player and resetScore look http://pastebin.com/nVySNb3x Please help me!!
Don't store players in HashMaps! If the player logs out you will still have the instance in your HashMap which doesn't allow the player and the chunks it would be on to be despawned and unloaded, this causes problems over time and can lead to excessive memory use because the server can't free the ram that the player in your HashMap is hogging.
tommycake50 Not necessarily. If you remove the player instance accordingly when you should, then keeping the player object is still okay. Mother__ I'll look at your code.
You need to create a new scoreboard for each player that logs in the server and (since you are storing players in a hashmap) remove the player from the map once he logs out.