Hey, i want co reate /heal command with uuid support, but if i want to do /heal <name> and on server will be 2 players with same name, what should i do? I dont want to write full uuid into a command likee /heal sdjsdjsdj-22323-sdds its moron.
DevManABCD players cant have the same name, can they? Also, you could give every Player a own id like 0, 1, 2 ,3 .... and show them up in a little scoreboard to every player on the server. then if you want to heal them use /heal 0 and /heal 0, 1, 2, 3, ... for multiple players. use a HashMap<Integer, UUID> for this then you can easy access every UUID for its id you gave them
You can try healing all of them? Personally, I would add all to an ArrayList and maybe parse another argument to get the player at a certain position in an ArrayList. I would also add a feature that uses the distance formula to print out the numbered places and the distances. That way, if someone was close to them that they wanted to heal, they would know which spot(in the arraylist) is closest.
1.8 adds nickname changes, so if one player named ... notch will be on seerver, and one person with nick jeb change hes nickname to notch, there will be 2 notches on server. so if i put /heal notch this will heal them all... I dont use hashmaps, object oriented programming
DevManABCD rlly? you don't use a good and easy solution because you don't like it? Also you can set up an own class which has a HashMap and some methods to access it like addUUID(int id, UUID playerUuid) remove(int id) get(int id) and make an instanze of it. then you got your object oriented programming, don't you? :O
Please, dont comment this thread anymore. Shmobi i uses something better with one "unlimited" arraylist.. Yea when i do Player op = Bukkit.getPlayerExact(args[0]); then on server will be 2 notches, how can i get 100% true notch what i mean?... At 1.8 too? If its true i need to learn something more in patch notes :O EDIT by Moderator: merged posts, please use the edit button instead of double posting.
So uuid is only required in data saving and loading not for using at this time. Thanks, that was very helpful!