Industrial Foregoing

Industrial Foregoing

95M Downloads

Animal Feeder does not feed Horses or Llamas

ADDSynth opened this issue ยท 3 comments

commented

Industrial Foregoing Version:
industrial-foregoing-1.15.2-2.3.3-e356e61

Story: (you can skip)
Okay. My buddy and I are using the Mob Feeder, Animal Baby Separator, and Mob Slaughter Factory, to kill mobs and get liquid meat. We've been using Cows. But now that I'm learning how the Mechanical Dirt works, it needs to be filled up with liquid meat, so I'm looking for ways to increase our liquid meat production. So I look through the source code and I see that the amount of meat produced depends on how much health the mob has. So for instance we're using cows which have 5 hearts. We were thinking about mobs that have the most health that can also produce babies so of course we thought of Horses which have anywhere from 7 to 15 hearts.

The Issue:
But then we come to find out that the Mob Feeder doesn't feed Horses. (You can feed them Hay Bales to breed them by the way.)

The Fix:
So I took another look at the source code. The machine finds mobs which derive from AnimalEntity and then calls the entity's getFeedingItem(ItemStack) method, which for most animals would return Wheat or Seeds. However, Horses and Llamas derive from the AbstractHorse class which overrides the getFeedingItem() method and just returns false. So the fix is simple. Just add more checks to see if the entity is a Horse or Llama, then check if the input ItemStack is a Hay Bale. You have to directly check for the Horse and Llama mobs because the Donkey, Mule, Skeleton Horse, and Zombie Horse also derive from AbstractHorse, but they cannot be bred with Hay Bales.

commented

Horses need to be tamed and eat Golden Carrots or Golden Apples. Llamas need to be tamed and eat hay bales.

commented

Note:
shortly after we thought of using horses a Wondering Trader appeared in our base, with 2 Llamas! So we quickly did what was necessary to tame the llamas and confirmed they can be fed Hay Bales to make a baby llama. We swapped our cows with the llamas and that's how we discovered the Mob Feeder doesn't feed llamas. But an additional note, after a while the llamas started to despawn. I'm not that familiar with Horse and llama behaviour myself, so I suspect that Horses don't check to see if they're in an enclosed space like the other animals and will despawn naturally, but WILL stay if they are tied down with a Lead. I couldn't find any information on the Minecraft wiki page about horses that mention their despawning behaviour.

commented

Note:
shortly after we thought of using horses a Wondering Trader appeared in our base, with 2 Llamas! So we quickly did what was necessary to tame the llamas and confirmed they can be fed Hay Bales to make a baby llama. We swapped our cows with the llamas and that's how we discovered the Mob Feeder doesn't feed llamas. But an additional note, after a while the llamas started to despawn. I'm not that familiar with Horse and llama behaviour myself, so I suspect that Horses don't check to see if they're in an enclosed space like the other animals and will despawn naturally, but WILL stay if they are tied down with a Lead. I couldn't find any information on the Minecraft wiki page about horses that mention their despawning behaviour.

Trader Llamas will despawn with the trader after a certain amount of time, no other passive mobs despawn IIRC