List<String> listArgs = new ArrayList<String>();
if (itemArg != null){ listArgs.add(itemArg); }
if (amountArg != null){ listArgs.add(amountArg); }
if (damageArg != null){ listArgs.add(damageArg); }
ItemStack stack = ItemStackParser.parse(listArgs.toArray(new String[]{}), sender);
if (stack == null){ return; }
target.getInventory().addItem(stack);
Material item = stack.getType();
int amount = stack.getAmount();
short damage = stack.getDurability();
// Messages will be different if the player spawned the item for himself, or someone else
if (sender != target){
LogHelper.showInfo("itemYouGave#####[" + Nicknames.getNick(target.getName()) + " " + amount + " " + Utils.userFriendlyNames(item.name()) + (damage != 0 ? " (" + damage + ")": ""), sender, ChatColor.AQUA);
LogHelper.showInfo("itemGiveSuccess#####[" + amount + " " + Utils.userFriendlyNames(item.name()) + (damage != 0 ? " (" + damage + ")": "") + " #####itemFrom#####[" + Nicknames.getNick(sender.getName()), target, ChatColor.AQUA);