Hey, I am new to the bukkit api (like 2 months) and I am working on a big project but am having trouble adding. I do this: Code: getConfig().set(p.getName() + " Points", getConfig().getString(p.getName() + " Points") + args[1]); But I get things like 1 + 1 = 11... I know I am a noob but if someone could help that would be great. Thanks!
@_Die If you didn't know how to do this already, I'm guessing that you didn't use Integer.parseInt(args[0]) instead of just typing args[0].
It's ".Points" not "Points". Many other things you should fix too. Will post when I get on my computer
There is no error. It's just the adding. For example, Code: p.sendMessage(ChatColor.RED + getConfig().getInt(p.getName() + " Points") + args[1]); I would get something like 10 + 10 = 1010
int totalPont = getConfig().getInt(p.getName() + " Points") + Integer.parseInt(args[0]); p.sendMessage(ChatColor.RED + Integer.toString(totalPoint));
@_Die The period is creating a sort of indentation in the YAML file. http://wiki.bukkit.org/Configuration_API_Reference ^All you need is there.