An ELT Glossary : Optative Mood
Optative sentences are those where the speaker/writer makes a wish of some sort. In English there is no specific grammatical form for optative mood, though there is in some other languages such as Albanian. English expresses the optative in a variety of ways, including :
a) the imperative : God save the Queen! / Live long and prosper!
b) May + infinitive : May all your troubles be little ones
c) If only + the second form of the verb, expressing a hypothetical state : If only I had the money to go!