No, Elves are not immune to Hypnotic Pattern, but their Fey Ancestry racial trait gives them benefit on saving throws in opposition to currently being charmed, that may assist them resist its results. The spell ends for an afflicted creature if it requires any harm or if some other person https://www.youtube.com/shorts/2bqrDoavYZM