@Command(
			name = "pickpocket",
			aliases = {},
			player = true,
			permission = "masters.pickpocket",
			description = "Pickpocket a Player's inventory or Ender Chest",
			usage = "/<command> [-e] <player>"
	)
	public void openInventory(CommandSender sender, String[] args){
		if (args.length < 1)
			throw new CommandArgumentException();

		boolean enderChest = args.length == 2 && args[0].equals("-e");

        if (enderChest && args.length < 2)
            throw new CommandArgumentException();

        String targetName = enderChest? args[1] : args[0];
        OfflinePlayer target = Bukkit.getOfflinePlayer(targetName);
        Player p = Bukkit.getPlayer(sender.getName()).getPlayer();

        try {
            if (enderChest)
                p.openInventory(((HumanEntity) target).getEnderChest());
            else
                p.openInventory(((HumanEntity) target).getInventory());
        } catch (ClassCastException e) {
            p.sendMessage(ChatColor.RED + "Can't open this inventory");
        }
    }