Feeding troughs and edible hay
Mod version shipped with FlammiCraft: 0.17.0
TDAnimals includes the local Smart Feeding Troughs 1.5.0 implementation. The trough has four inventory slots and feeds reachable adult animals that can breed. Compatible partners, species-appropriate food and capacity for offspring are required. Hoppers can insert from above or the sides; automatic extraction from below is not supported. Open the trough with an empty hand.
Use shears on a normal hay bale to create edible hay with eight portions for animals that accept wheat as breeding food. Partly eaten hay retains its remaining portions. Animal claims and birth reservations are rebuilt after a restart; they are transient state rather than saved inventory.
Stored contents
The trough and hay use the IDs tdanimals:smart_trough and tdanimals:edible_hay_block. Former smartfeedingtroughs IDs are no longer read; old worlds are not migrated.
Placement also preserves trough contents stored in minecraft:block_entity_data.Items when the item has no separate minecraft:container component. When a container component is present, its contents take precedence; an explicitly empty component clears the inventory. Regression tests cover both storage forms, including item serialization, placement and block-entity save/reload. Contents already lost and saved as empty cannot be reconstructed by this fix.
Configuration
The Config button for TDAnimals in the Mods list opens the native “TDAnimals Settings” screen with its “Troughs” section. Outside a world it edits local values; while connected it shows server values. Server edits require operator level 2.
All four values are in [troughs] in config/tdanimals-common.toml:
| TOML key | Default | Allowed |
|---|---|---|
range |
16 | 1–32 blocks |
max_claimed_animals |
24 | 4–24 animals |
trough_claim_check_interval |
600 | at least 1 tick |
feed_chance |
0.5 | 0.01–1.0 |
The file contains only this section. Other entries are removed on load; the four trough values are kept. Invalid values stop loading with a readable error without changing the file. A former config/smartfeedingtroughs/smartfeedingtroughs.json is no longer imported.
Operators can use /tdanimals config show, get <setting>, set <setting> <value> and reload. Command setting names are range, maxClaimedAnimals, troughClaimCheckInterval and feedChance. Reload reads tdanimals-common.toml and synchronizes trough settings to connected clients.
Automated tests check stored trough inventories, the absence of the former IDs, configuration, commands, and existing feeding/menu behavior without starting a Minecraft server. Rendering and actual animal AI still require manual runtime acceptance.