I think I watched this movie on a vhs tape that my mom rented. It was probably around 2003 to 2005. Anyways I barely remember one scene where the main character, which was a little boy, walking through an alien space ship to look out a window and this small alien took the kids hat off and ate it. That’s all I can remember.
Maybe this?
Explorers
http://imdb.com/rg/an_share/title/title/tt0089114/
Flight of the Navigator
Definetely flight of the navigator