I know what you mean. Joel almost does that but instead of nipping he jumps from his sleep and tries to find something to protect when someone comes in the room, lol.
It's hard to scold him about it when he jumps from his sleep

But he's getting better since I tell him to stop and go back to bed and he barely does it anymore.