Editing villager profession pathfinding goals

Discussion in 'Plugin Development' started by joshieman06, Jul 12, 2023.

Thread Status:
Not open for further replies.
  1. Offline

    joshieman06

    Hey guys, I wanted to start on a project but I have no idea how I would do it.

    I want to change the farmer profession so that villagers also till the ground around their composter.

    I am fairly new to plugin development and would appreciate any ideas anyone has. I'm not asking for code, just a general idea of how it would be accomplished.
     
  2. Offline

    EvilWitchdoctor

    The Bukkit API does not appear to have events for (block) random ticks or (entity) villager target/pathing, so instead of a Listener you might need to use BukkitRunnable to schedule periodic tilling action.

    After that, the specific details are up to you --
    * Should tilling occur at random intervals or fixed times?
    * Should villagers choose an un-tilled block and pathfind towards it, or only check if the block below their feet should be tilled (less complicated)?
    * How will this effect the farmer's regular duties, and what tasks will they prioritize


    Myself (and others) will be willing to review code and help advise if you get stuck or need help optimizing something, especially in delicate cases like this where potentially lots of entities are involved, just remember to tahg me;)
     
  3. Offline

    joshieman06

    Thank you for your response @EvilWitchdoctor. I feel that the action of tilling should be similar to the action of harvesting a mature crop.

    Just tilling the block under could be acceptable, but it would be cool if they checked all the blocks around their workstation.

    Tilling should be their first priority, because you can't plant anything if there isn't any farmland. Thank you for your help.
     
Thread Status:
Not open for further replies.

Share This Page