Well birds can become like this for MANY reasons.

If a female may be trying to lay some eggs and will get very protective and try to bite or wing slap.Birds can change there moods so fast sometimes like Argranade my pigeons used to love me now all he does is mate with pigeon females and bites me lol.

So any way just try giving your bird some treats and speak in a low voice let the bird sit on your shoulder and gently try to pet it maybe try to find out the gender maybe it even wants a mate.

What type of bird is this?