Minecraft Data Packs / Other

[AFH] - Auto feed husbandry v2.0.0

  • check_circle Functions
  • 10,779 views, 7 today
  • 1,097 downloads, 0 today
  • 10
  • 15
  • 4
MaximusArg1982's Avatar MaximusArg1982
Level 34 : Artisan Modder
4
This datapack allows you to breed/heal animals by dropping their breeding/healing food near them, instead of having to use it on them directly. Which can be bothersome when you have a big enough amount of them around and they're all pushing you around.

I tested it on Vanilla versions release 1.14.4

Tutorial - Installing a data pack

Make sure to remove any old versions of this datapack (including "Hungry cows" as it was original named) before installing the newer one to avoid incompatibilities



This mod is now MODULAR!!! Which means, you can make your own plugins to expand the animals/food it uses (e.g: animals from mods, or feeding zombies or creepers for your nefarious plans 0.o)

If the interest arises, I will upload the datapack as a Core + separated modules so you can choose which of the animals I included you want the mod to work with in your games; and as an example of how to make your own plugins.



How the pack works?
  • Drop the correct food items close by an adult animal with no breeding/feeding cooldown (see special cases below)
  • Currently implemented: cows, sheep, mooshroom, pigs, chickens, wolves, cats, horses, donkeys, llamas.
  • Animal will consume the item if the conditions are met.
  • If it's a breeding item, the animal will activate love mode if it's not active already.
  • In the case of wolves and cats, if they are not at full health when they consume the item, they will instead heal.
  • In the case of horses, donkeys, llamas, they will consume the item even if they are already in love, as long as their health is not full. In the case of healing only items, they won't activate love mode.
        • Animals will detect item dropped as far as one block away (so they may not eat through a block/wall/fence/etc in the way).
        • When eating, one item will be subtracted from the item entity stack. Meaning:
        •   When you drop only one item, it will disappear.
        •   When you drop a stack, it will be reduced for as many hungry animals close by eat from it, probably leaving leftover items (i,e: dropping a stack of 10 wheat, close by two hungry cows, will leave behind 8 wheat)
        • You may automate this with dispenser/dropper redstone circuits!!
        • You may disable an animal from eating food the floor (for health purposes, ofc ...) by tagging them with a afh_disable tag.

        Important Notes:
        • In the spirit of keeping the mod the break vanilla the least possible. I included modules that only works for adult animals which are neither currently in love (feeding cooldown) nor in breeding cooldown, nor at full health (in case of healing items)
        • This is in no way a modification of AI behavior, it works by arbitrary entity detection with /execute selectors.
        • The pack executes it's code with the new /schedule command, every 1 second. to avoid increasing lag, so lava, hoppers, etc will most probably capture the items before the animals do. So have in mind some times the animals won't insta-eat
        • Default datapack modules only work for vanilla minecraft entities, and dropping/summoning vanilla breeding items, if you use mods that disable these entities it won't work. It also won't work for same name animals/items with different ids.
        • Cows, sheep, mooshroom will eat wheat
        • Pigs will eat either carrots, potatoes, or beetroots (in this order)
        • Chickens will eat either wheat seeds, pumpkin seeds, melon seeds or beetroot seeds (in this order)
        • Wolves will eat raw/cooked porkchop, beef, chicken, rabbit, muton (in this order) and lastly rotten flesh (don't be mean to your wolves...)
        • Cats will eat raw cod, raw salmon (in this order)
        • Horses and Donkeys will eat golden carrots and golden apples (in this order) as their breeding items; sugar, wheat, regular apples, and hay bale (in this order) as their healing items
        • Llamas will eat hay bale as their breeding item, wheat as their healing items.


        Future versions ideas/improvements I intend to implement
        • Add remaining vanilla breedable animals with their respective food to the mod.
        • Add the possibility for animals that eat produce, to break mature crops to eat when hungry (enabled/disabled by mobGriefing gamerule)
        • Either add animal thirst to this mod, or make a new mod for that which works together with this one.

        Credits and mentions
          Vazkii the mod maker, for the inspiration. In his Quark mod(https://quark.vazkii.net) one of the automation modules produces this same effect.
          But since the mod is not available beyond 1.12 (as of this date) I wasn't able to have this functionality in 1.14 thus I made this small datapack to add it.
        CompatibilityMinecraft 1.14
        toMinecraft 1.16
        Tags

        4 Update Logs

        v 2.0.0 : by MaximusArg1982 09/19/2019 9:30:05 pmSep 19th, 2019

        Added Horses, Donkeys, and Llamas to the mod.
        Similar mechanics to wolves and cats, but they can keep eating as long as their health is not full and in love.

        Remade the mod to be modular, to allow for plugins to expand it's functionality

        Updated video showcase

        Removed not funny joke from mod description. Only one of them :)
        LOAD MORE LOGS

        Create an account or sign in to comment.

        Cawfee
        01/19/2020 12:22 pm
        Level 1 : New Miner
        Cawfee's Avatar
        Hi! I love this data pack. Please Update to use with MC 1.15.1 and Forge. TY!
        1
        MaximusArg1982
        01/24/2020 9:15 pm
        Level 34 : Artisan Modder
        history
        MaximusArg1982's Avatar
        You should have no issues with MC 1.15, I was using the 1.15 snapshot while I made it.
        This is not a Mod, it's a datapack; It works on core game mechanics; forge shouldn't be a problem.
        1
        Kramnik13
        09/16/2019 11:38 am
        Level 1 : New Miner
        Kramnik13's Avatar
        Hey, great datapack!
        I'm in 1.14.4 with optifine, on a flat world, and when I try to drop wheat seeds to a chicken (adulte) nothing happen, in survival or creative.. I tried with wheat for cows also but same result
        1
        MaximusArg1982
        09/16/2019 9:26 pm
        Level 34 : Artisan Modder
        history
        MaximusArg1982's Avatar
        Are you using a vanilla chicken? (minecraft:chicken)
        Is the chicken already in love? (once they are in love, they have a feed cooldown)
        Has the chicken recently bred? (once they breed, they have a breeding cooldown)
        Are you using vanilla wheat seeds? (id: minecraft:wheat_seeds)

        run this command: if no "Hi" appears in your chat, it means one of the selector conditions ain't met.
        Either it's not a minecraft:chicken entity, it's not an adult (Age < 0), it's on breeding cooldown (Age > 0), or is on feed cooldown (InLove > 0)

        /execute as @e[type= minecraft:chicken, tag= !afh_disable, nbt= {Age: 0, InLove: 0}] run say "hi"

        Also, make sure you didn't tag it with afh_disable :)
        1

        Welcome