SmartBrainLib (Forge/Fabric/Quilt)

SmartBrainLib (Forge/Fabric/Quilt)

24M Downloads

Pluggable on top of the vanilla Brain system of Villagers?

elegos opened this issue ยท 3 comments

commented

Hello!

I'm building a custom villager profession which should act in a particular way and stumbed upon the Brain / Activity / Task system. Or at least at its definition building (VillagerTaskListProvider anyone?). I highly suspect an intern wrote that code, due to the extreme cyclomatic complexity. I searched documentation around the entire net (using Fabric), but found literally NONE.

That's when I fuond out this library. Now the question is: can I use this lib in order to specify a particular behavior of a villager with a particular profession, or should I replace the villager behavior all at once? (I hope for the former...).

Currently I'm injecting an (empty) list of tasks using a mixin on the VillagerTaskListProvider::createWorkTasks method.

Thanks ๐Ÿ‘

commented

It's a bit of an odd one

if I'm understanding you correctly, you could probably use BrainUtils#removeBehaviour to remove a specific behaviour in the villager

commented

Hmmm... not exactly, as it would replace the whole behavior, also of the standard villagers. How unfortunately. Though I think I messed enough to make my own priorty-based work behavior, as you can see here: https://github.com/elegos/mc-woodsman/blob/main/src/main/java/name/giacomofurlan/woodsman/villager/task/WoodsmanWorkTask.java :D (obviously more behaviors to come)

commented

Well yeah, you'd check the profession of the villager before using it