Oh, gee, I'd just be guessing here. . . but I have some questions/observations.
How long have you had your little guy? Does he have company? How much training have you done with him?
My little molly mule does moves like this when she plays with her horse buddy. She knows better than to try it with me! Donkeys do play pretty rough, do you think it possible your little fella is trying to play with you? I suppose it
could be a dominance display, or maybe he thinks he's guarding something? At best, this is extremely disrespectful behavior (not to mention being potentially dangerous!) and needs to be stopped. He needs to learn that you are nice to be around, but he should keep all of his feet on the ground and his mouth to himself, around you! Hopefully, someone else will chime in here soon, with specifics about how that is best done with a donkey.
Donkeys do best with other donks for company. If your little dude is alone, you ought to consider getting him a (well-behaved!!) friend. That way, he can take out his friskiness on someone better equipped to deal with it.
Hopefully someone here can help you get him straightened out soon. You shouldn't have to carry a weapon just to stroll across the pasture. Your animals are supposed to be your friends, after all.
Oh, yes, and. . . .Welcome to the forum!