TRAPPING DAMAGERS ON SHABBOS [Shabbos: trapping: damagers]
Gemara
(Rav Yehudah): Hash-m did not create anything for naught!
The fly was created for [healing a sting of] a hornet. The mosquito was created for [healing a bite of] a snake. The snake was created for [healing] boils...
3a (Shmuel): All Peturim in the Mishnayos of Shabbos are forbidden, except for three, which are permitted - 'trapping' a deer (that is already trapped), trapping a snake, and breaking an abscess to enable pus to leave.
106b (Beraisa #1 - R. Meir): If one trapped grasshoppers, wasps or mosquitoes on Shabbos, he is liable;
Chachamim say, one is liable for species normally trapped, and exempt for species not normally trapped.
107a (Mishnah #1): If one traps a snake on Shabbos so it will not bite him, he is exempt. If he trapped it for Refu'ah (to use it for a cure), he is liable.
Question: What is the source that [in the first case] it is permitted?
Answer (Mishnah): One may put a bowl over a scorpion so it will not bite.
(Mishnah #2): If one traps any of the eight Sheratzim listed in the Torah he is liable;
If one traps other Shekatzim u'Rmasim (vermin), he is liable only if it was for a need.
(Beraisa - R. Eliezer): If one traps a flea on Shabbos he is liable;
R. Yehoshua exempts.
(Rav Ashi): R. Eliezer obligates even if the species is not normally hunted. R. Yehoshua exempts in such a case.
(Rav Yehudah): Mishnah #2 obligates one who trapped only if it was for a need. It is like R. Shimon, who exempts Melachah she'Einah Tzerichah l'Gufah.
(Mishnah #1): If one traps a snake on Shabbos so it will not bite him, he is exempt. If he trapped it for Refu'ah, he is liable.
(Rav Yehudah): This is like R. Shimon, who exempts Melachah she'Einah Tzerichah l'Gufah.
Rishonim
Rambam (Hilchos Shabbos 10:21): Both for the eight Sheratzim mentioned in the Torah, and other species of Shekatzim u'Rmasim that are normally trapped, one who traps one of them, whether or not it is for a need, he is liable, since he intended to trap. One is liable for a Melachah she'Einah Tzerichah l'Gufah.
Ra'avad: Above (1:7), I wrote R. Chananel's opinion. (He rules like R. Shimon, who exempts Melachah she'Einah Tzerichah l'Gufah, since Rava holds like him.)
Rambam (25): On Shabbos one may trap Remasim that damage, such as snakes and scorpions and similar things. Even though they do not kill, since they bite, one may trap them on Shabbos. This is if he intends to be saved from their bite. He covers them with a Kli or surrounds them or ties them up so they will not damage.
Ran (38a DH l'No'el): The Rashba brings from the Yerushalmi that if one wanted to lock his house, and saw a deer inside, he may intend also for the deer. If he saw a child drowning, and he intended to take him and fish out of the water, it is permitted. This is unreasonable. How can we permit trapping just because he wants to lock his house? Even R. Shimon forbids a Pesik Reishei! Rather, the Yerushalmi means that if he intended only to lock his house, and afterwards found a deer inside, he need not let it out. However, regarding the child he may intend for Melachah of Reshus together with Piku'ach Nefesh. It is permitted, for it is Melachah of a Mitzvah. He is obligated to do it. Chachamim permitted to also intend for Melachah, lest he refrain from his obligation.
Ran (40a DH v'Af): The Gemara taught several cases, to teach that even though he does another Melachah that he needs along with the Piku'ach Nefesh, it is permitted.
R. Akiva Eiger (on Magen Avraham 328:8): Yoma 84a permits breaking a door (to save a child), even if he intends also for the fragments. The Rosh (Yoma 8:13) and Ran (Shabbos 40a DH Tanu) permit even if he intends also for Melachah of Reshus.
Poskim
Shulchan Aruch (OC 316:3): If a species is not trapped, one who traps it is exempt, but it is forbidden. Therefore, even though people do not trap flies, one may not trap them.
Magen Avraham (6): One is exempt even if he traps them for a need.
Shulchan Aruch (7): On Shabbos one who traps snakes or other Remasim that damage, if it was for Refu'ah, he is liable. If he intended so they will not bite him, it is permitted.
Magen Avraham (12): It is permitted because it is a Melachah she'Einah Tzerichah l'Gufah. Chachamim did not decree in a case of damage. According to the Rambam (who obligates for Melachah she'Einah Tzerichah l'Gufah), it is because he does not trap normally. Rather, he is like one who is Mis'asek (engaged in a permitted activity). It is permitted even if they do not kill, for these species are not [normally] trapped, like it says in Sa'if 3. See 334:27 (below).
Mishnah Berurah (26): This is even where snakes do not normally kill, and they are not chasing him, rather, they are stationary. Then, one may not go to kill them (Sa'if 10). Even so, one may trap them, since it is Melachah she'Einah Tzerichah l'Gufah. He needs to trap them only so they will not damage. If he would know that they will stay still and not harm him, he would not trap them. We forbid Melachah she'Einah Tzerichah l'Gufah only mid'Rabanan. Here, due to damage, there is no Isur mid'Rabanan. Even the Rambam agrees here, for this is not considered Melachah at all. It is like Misasek, for he does not want to trap at all. He would rather expel the damager from himself!
Bi'ur Halachah (DH ha'Tzad): In places where they regularly kill, e.g. snakes in Eretz Yisrael and scorpions in Chadyeiv, perhaps even if he intends for Refu'ah, he is exempt, since it is a Mitzvah to eradicate them from the world, lest they kill people, like in Sa'if 10. This is like it says in Yoma 84b, that if a child was drowning in a river, and one spread a net and saved him, even if he intended to trap fish [he is exempt]. One can reject this proof. Here he intends only for the cure, and not for both. This is like in Pesachim 25b, when it is impossible (to avoid benefit from Isur) and he intends to benefit; it is forbidden. The Sugya forbids spreading out an Aveidah (for his benefit), even though the Torah obligates spreading it out (lest it get moldy). Also here, even though the action itself is a Mitzvah where snakes often kill, it is worse due to his added intent.
Bi'ur Halachah (DH Nechashim): Snakes are a species that people trap, since one is liable for Refu'ah. Chemed Moshe asked why the Rambam omitted the Mishnah that obligates one who traps a snake for Refu'ah. I answer that the Rambam obligates for Melachah she'Einah Tzerichah l'Gufah, and he wrote that one is liable for all species of Shekatzim u'Rmasim that are normally trapped, even if he trapped without a need or to play with them. If so, one who trapped a snake even not for Refu'ah is liable. He is exempt only if he trapped in order that it will not bite him, which he calls like Misasek. Even R. Yehudah exempts, since he does not intend to trap at all, just to get it away from him. If he had any intent to trap, even without any need, he is liable. The Mishnah obligates one who traps for Refu'ah is liable. It is like R. Shimon, like the Gemara says. Poskim ask why the Rambam permits in order that it not bite him. The Gemara explicitly said that this is like R. Shimon! The Magid Mishneh answered that Shmuel argues with Rav. This is difficult. I answer that the Reisha 'for Refu'ah he is liable' is like R. Shimon, but all agree to the Seifa (which permits in order that it not bite him).
Bi'ur Halachah (ibid.): Alternatively, the Rambam omitted the Mishnah because he holds that snakes are not normally trapped, and the Mishnah is like the Tana'im (106b, 107a) who obligate even for a species that is not normally trapped. We hold that one is exempt, so it is only an Isur mid'Rabanan. Chachamim did not decree if he intends that it not bite him. Also Rashi (107a DH v'She'ar and DH she'Lo) holds that snakes and scorpions are not normally trapped. They are trapped only to kill them and distance them from people. This is not called a species that is trapped, just like fleas. The Rambam holds that trapping for Refu'ah is not called trapping, for also flies help for Refu'ah (Shabbos 77b)! Even so, the Tosefta and Gemara (107b) call it something that is not trapped. Even though R. Yochanan ben Zakai was unsure if one who trapped a scorpion is Chayav Chatas (121b), and the same applies to snakes, his Talmidim R. Eliezer and R. Yehoshua argue about whether one not normally trapped. Their Rebbi was unsure about this. We hold that one is exempt for this, but it is Asur mid'Rabanan.
Kaf ha'Chayim (56): Perush ha'Mishnayos (Shabbos 16:7) and the Bartenura say that it is forbidden to trap a snake in order to play with it. The Tosfos Yom Tov says that this is imprecise. Really, one is liable for this.
Shulchan Aruch (334:27): If a [glowing] coal is in a place where many can get hurt from it, one may extinguish it whether it is of metal or wood. The Rambam forbids if it is of wood.
Magen Avraham (35): Chachamim did not decree about Melachah she'Einah Tzerichah l'Gufah if damage can result. If the only concern is monetary damage, it is forbidden. The Rambam obligates for Melachah she'Einah Tzerichah l'Gufah, so he permits only if it is of metal, which does not burn.