@SuppressWarnings("deprecation")
    private void parseCommand(CommandSender sender, String... args)
            throws EntityEffectError {
        Player senderPlayer = (sender instanceof Player ? ((Player) sender)
                : null);
        Player player = null;
        PlayableEntityEffect effect = null;
        
        if (args.length > 0) {
            try {
                effect = PlayableEntityEffect.parse(args[0]);
            } catch (NullPointerException e) {
                throw new EntityEffectError("You must specify an effect.");
            } catch (IllegalArgumentException e) {
                throw new EntityEffectError("Unknown entity effect: " + args[0]);
            }
        }
        if (args.length > 1) {
            player = plugin.getServer().getPlayerExact(args[1]);
            if (player == null) {
                throw new EntityEffectError("Unknown player: " + args[1]);
            }
        }
        playEffect(effect, senderPlayer, player);
    }