Really sorry for having to post threads so quickly and close to each other, but i can't find the problem in this code. with the command being enchant. please help! Code: if(args.length == 2){ if (args[0].equalsIgnoreCase("sharpness") && args[1].equalsIgnoreCase("1") ) { try { if(Economy.hasEnough(p, BigDecimal.valueOf(1000))){ //Do something, perhaps send them a message? player.getItemInHand().addEnchantment(Enchantment.DAMAGE_ALL, 1); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "economy take " + player.getName() + " 1000"); player.sendMessage(ChatColor.BLUE + "Sharpness 1 Bought. " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + "$1000"); return true; }else player.sendMessage(ChatColor.RED + "You do not have $1000"); } catch (ArithmeticException | UserDoesNotExistException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
Cryices 1. Make it easy for our eyes. Plz pase your code using the little code insertion thingy 2. Describe what the problem is or we won't be able to help you
there, and the problem is, the command /enchant sharpness 1 doesn't work! it doesn't send a message nor remove money nor, do anything. but /enchant and /enchant sharpness works!
Cryices Try changing: Code:java if (args.length == 2) to Code:java if (args.length == 1) Let's see if that has any effect first. I'll continue trying to see what the problem is EDIT: or you can simply put: Code:java if (args.length > 0)
I believe you don't use Essentials Eco API, they use Vault's Eco API, so I think you need to use Vault's API I'm not entirely sure though.
no because i looked under here http://wiki.ess3.net/wiki/Essentials_Economy/API Am i using the api correctly though?