The Rambam · Sefer Nezikim
הלכות נזקי ממון ג׳Damages to Property 3
Chapter 3 of 14 in Damages to Property — 15 halachot
Halacha 1א׳
הַבְּהֵמָה מוּעֶדֶת לֶאֱכל פֵּרוֹת אוֹ יְרָקוֹת וְכַיּוֹצֵא בָּהֶן. לְפִיכָךְ אִם נִכְנְסָה לִרְשׁוּת הַנִּזָּק וְאָכְלָה דְּבָרִים שֶׁדַּרְכָּהּ לְאָכְלָם מְשַׁלֵּם נֵזֶק שָׁלֵם שֶׁנֶּאֱמַר (שמות כב ד) "וּבִעֵר בִּשְׂדֵה אַחֵר מֵיטַב שָׂדֵהוּ" וְגוֹ'. וְאִם אֲכָלָתָם בִּרְשׁוּת הָרַבִּים פָּטוּר. וְאִם נֶהֱנֵית מְשַׁלֵּם מַה שֶּׁנֶּהֱנֵית לֹא מַה שֶּׁהִזִּיקָה:
An animal is mu'ad, forewarned, to eat produce or vegetables and the like. Therefore, if it entered the domain of the injured party and ate things that it is its way to eat, he pays full damage, as it is said (Exodus 22:4), "and it feed in another man's field; of the best of his own field," and so forth. And if it ate them in the public domain, he is exempt; and if it had benefit, he pays for what it benefited, not for what it damaged.
Halacha 2ב׳
כֵּיצַד. נִכְנְסָה לִרְשׁוּת הַנִּזָּק וְאָכְלָה שֻׁמְשְׁמִין אוֹ לוֹט וְכַיּוֹצֵא בָּהֶם בִּשְׁוֵה דִּינָר מְשַׁלֵּם דִּינָר. וְאִם אֲכָלָתָן בִּרְשׁוּת הָרַבִּים וְנֶהֱנֵית רוֹאִין אוֹתָן כְּאִלּוּ הֵן שְׂעוֹרִים אוֹ עָמִיר וּמְשַׁלֵּם דְּמֵי עָמִיר אוֹ דְּמֵי שְׂעוֹרִים בְּזוֹל:
How so? If it entered the domain of the injured party and ate sesame or ladanum and the like to the value of a dinar, he pays a dinar. And if it ate them in the public domain and had benefit, they regard them as though they were barley or fodder, and he pays the price of fodder or the price of barley at the cheap rate.
Halacha 3ג׳
אָכְלָה אֳכָלִין הָרָעִים לָהּ כְּגוֹן שֶׁאָכְלָה חִטִּין הוֹאִיל וְלֹא נֶהֱנֵית פָּטוּר. אָכְלָה אֳכָלִין שֶׁאֵין דַּרְכָּהּ לְאָכְלָן כְּגוֹן שֶׁאָכְלָה כְּסוּת אוֹ כֵּלִים בֵּין בִּרְשׁוּת הַנִּזָּק בֵּין בִּרְשׁוּת הָרַבִּים מְשַׁלֵּם חֲצִי נֵזֶק שֶׁזֶּה שִׁנּוּי הוּא וְדֶרֶךְ בְּנֵי אָדָם לְהַנִּיחַ כְּלֵיהֶם וּכְסוּתָן בִּרְשׁוּת הָרַבִּים עַד שֶׁיָּנוּחוּ מְעַט:
If it ate foods that are bad for it, such as wheat, since it had no benefit, he is exempt. If it ate things that it is not its way to eat, such as clothing or vessels, whether in the domain of the injured party or in the public domain, he pays half damage, for this is a deviation; and it is the way of people to set down their vessels and their clothing in the public domain while they rest a little.
Mishneh Torah, Torat Emet 363 edition, via Sefaria — public domain
English: rendered from the Hebrew for this app — our own, not a borrowed translation