From: Josh in NY
If a person does a mitzvah in a dream, does he get the reward? Can the gemara statement about being excommunicated in a dream have anything to do with this? Are there any other sources you can recommend? Thank you for this great service.
The gemara you mention and Shulchan Aruch (Nedarim 8a, Y.D. 334:35) indeed say that one who dreams he is ex-communicated needs hatarat nidui, a nullification. Even if others dreamed his ex-communication (He'emek She'ela, sheilta 29:16), and even if he or others also dreamt the nullification, he still needs hatara. This is because every dream has both some truth and falsehood, such that the ex-communication may be the true part and the nullification the false part. Since there are prohibitions involved and since the situation can be corrected fairly simply through proper nullification, that is whats done.
However, this is different than doing a mitzvah in a dream since the ex-communication is being revealed from Above, which may be a reason to take the dream more seriously. Still, perhaps your question can be compared to another case discussed in connection with ex-communication, namely whether a vow made in a dream is binding.
Rashba says that one who vows in a dream needs hatarat neder, a nullification of the vow (in B.Y., Tur 210). This is because he "made" the vow, and it easily can be corrected. Chatam Sofer (Y.D. 222) explains that the fact the he dreamt the vow reveals that he must have had such intention while awake. Also, as above, it doesnt help if he dreamt the nullification since that may be the false part of the dream (Shach 4).
However, others (Rav Sherira Gaon, HaRosh in B.Y. ibid.) are of the opinion that one who makes a vow in a dream does not need hatara. They maintain that a vow which one dreams on his own is unlike ex-communication in a dream, which may be from Heaven. Also, they argue, a vow is binding only if one is fully conscious and actually verbalizes the words here he has neither. This is also the opinion of the Shulchan Aruch (Y.D. 210:2). According to this, dreaming of non-action mitzvot (such as belief, love and awe of G-d) might count, but dreaming of mitzvot that require action would not.
Or would they? Our Sages taught: "A good intention is considered as deed, as in Then the G-d-fearing men spoke to one another, and the Lord hearkened and heard it. And a book of remembrance was written before Him for those who feared the Lord and for those who valued His name (Malachi 3:16). What is meant by those who valued His name? Rabbi Asi said, "Even if a person intended to do a mitzvah but was unable to, G-d considers it as if he had done it" (Kiddushin 40a). Still, this is not conclusive since a persons lack of action in a dream, no matter how great his intention, is not comparable to one who consciously and actively tried to perform a mitzvah and was unable to for reasons beyond his control.
That being said, a persons dreaming of doing a mitzvah, insofar as its being an expression of ones spiritual orientation and inner desires, is a very great thing which, if not deserving reward for actually doing the mitzvah, is nevertheless deserving of its own reward. Furthermore, such a dream may also be a revelation from Above. Thus our Sages taught regarding mitzvah dreams, "One who prays in a dream is a good signOne who wears tefillin should anticipate greatness.One who reads the Shema is fitting for the Divine Presence to rest upon him.One who answers yhei shemei rabba is promised the World to Come" (Berachot 55-57).