Even though mourning does not apply during the Moed, nevertheless, aninut does apply during it. He is forbidden from meat and wine and is exempt from all the mitzvot, as I have written in Yoreh Deah siman 341. For aninut is certainly from the Torah, and the honor of Yom Tov does not supersede it, for the honor of the deceased takes precedence. Therefore, if one’s deceased relative died during Chol HaMoed—he is forbidden in all matters that an onen is forbidden in. And if his deceased relative died on Yom Tov, if he does not wish to bury him on that day, such as when he does not have non-Jews who are willing to attend to him—the law of aninut does not apply to him, for aninut only applies to one who wishes to bury him. And if he must wait until dark at the techum to prepare burial needs for him—then aninut takes effect upon him from the time he waits until dark at the techum. And if he does not need to wait until dark, as he does not need to attend to his burial needs—aninut does not take effect upon him until the next morning. And if he died on the second day of Yom Tov and he wishes to bury him on that day, or if he died on the first day of Yom Tov and wishes to bury him by means of a non-Jew—aninut takes effect upon him until after the burial. And we have already explained in Yoreh Deah there, section 15, that regarding the night of the second day of Yom Tov—aninut does not apply during it, for only the day of the second day of Yom Tov did the rabbis treat like a weekday, but not the night. Therefore, if he died on the first day of Yom Tov and he buries him the next day—aninut does not take effect upon him until the next morning, and during the night he is obligated in prayer, and kiddush, and in everything. And so too if he died on the night of the second day of Yom Tov, and certainly if he died on the night of the first day of Yom Tov, for aninut does not apply at night, even if he buries him the next day by means of a non-Jew. However, if he buries him at night—aninut certainly takes effect upon him until after the burial. (So wrote the Magen Avraham, subsection 8, that there is no aninut on the night of Yom Tov. And so wrote the Taz in Yoreh Deah and the Derishah there. And not like the Shach there, subsection 9, see there. And this is the ruling of the Maharil, see there.)
ואף על פי שאין אבלות נוהג במועד, מכל מקום אנינות נוהג בו. ואסור בבשר ויין, ופטור מכל המצות, כמו שכתבתי ביורה דעה סימן שמא. דאנינות וודאי דאורייתא, ואין כבוד יום טוב דוחה אותו, דכבוד המת קודם. ולכן אם מת לו מת בחול המועד – אסור בכל הדברים שאונן אסור בהם. ואם מת לו מת ביום טוב, אם אינו רוצה לקוברו בו ביום, כגון שאין לו אינם יהודים שירצו להתעסק בו – אין עליו דין אנינות, דאנינות אינו אלא ברוצה לקוברו. ואם צריך להחשיך על התחום להכין לו צרכי קבורה – אז חל עליו אנינות משעה שהחשיך על התחום. ואם אינו צריך להחשיך, שאין צריך להתעסק בצרכי קבורתו – לא חלה עליו אנינות עד למחר בבוקר. ואם מת ביום טוב שני והוא רוצה לקוברו בו ביום, או מת ביום טוב ראשון ורוצה לקוברו על ידי אינו יהודי – חל עליו אנינות עד אחר הקבורה. וכבר בארנו ביורה דעה שם סעיף טו דליל יום טוב שני – אין אנינות נוהג בו, דרק יום דיום טוב שני כחול שויוהו רבנן, ולא הלילה. ולכן אם מת ביום טוב ראשון וקוברו למחר – אין האנינות חלה עליו עד למחר בבוקר, ובלילה חייב בתפילה, וקידוש, ובכל דבר. וכן אם מת בליל יום טוב שני, וכל שכן דאם מת בליל יום טוב ראשון, דאין אנינות נוהג בלילה, אפילו אם קוברו למחר על ידי אינו יהודי. אמנם אם קוברו בלילה – וודאי חל עליו אנינות עד אחר הקבורה. (כן כתב(ו) המגן אברהם סעיף קטן ח, דאין אנינות בליל יום טוב. וכן כתבו הט"ז ביורה דעה והדרישה שם. ודלא כש"ך שם סעיף קטן ט, עיין שם. וזהו הוראת המהרי"ל, עיין שם.)