Interface VillagerBehavior

All Superinterfaces:
CreatureBehavior, EntityBehavior

public interface VillagerBehavior extends CreatureBehavior
Represents Behavior specific to Villagers
  • Method Details

    • harvestFarmland

      @NotNull @NotNull BehaviorResult harvestFarmland()
      Makes this Villager harvest Farmland.

      This behavior requires EntityMemory.LOOKING_TARGET and EntityMemory.WALKING_TARGET to be absent, and EntityMemory.SECONDARY_JOB_SITE to be present.

      Returns:
      Result of Behavior
    • showTrades

      @NotNull @NotNull BehaviorResult showTrades(int minDuration, int maxDuration)
      Makes this Villager show trades to a Player.

      This behavior requires EntityMemory.INTERACTION_TARGET to be present.

      Parameters:
      minDuration - Minimum Duration, in ticks, of showing
      maxDuration - Maximum Duration, in ticks, of showing
      Returns:
      Result of Behavior
    • showTrades

      @NotNull default @NotNull BehaviorResult showTrades(int duration)
      Makes this Village show trades to a Player.

      This behavior requires EntityMemory.INTERACTION_TARGET to be present.

      Parameters:
      duration - How long to show trades, in ticks
      Returns:
      Result of Behavior
    • resetProfession

      @NotNull @NotNull BehaviorResult resetProfession()
      Resets this Villager's profession.

      This method removes EntityMemory.JOB_SITE for you.

      Returns:
      Result of Behavior
    • giftHero

      @NotNull @NotNull BehaviorResult giftHero(int duration)
      Makes this Villager gift the hero of the Raid.

      This behavior requires the follow memories to be registered:

      This behavior also requires EntityMemory.NEAREST_VISIBLE_PLAYER to be present.

      Parameters:
      duration - Duration, in ticks, of gifting
      Returns:
      Result of Behavior
    • celebrateSurvivedRaid

      @NotNull @NotNull BehaviorResult celebrateSurvivedRaid(int minDuration, int maxDuration)
      Makes this Villager celebrate that they survived the Raid.

      This behavior does not require any memories.

      Parameters:
      minDuration - Minimum Duration, in ticks, of celebrating
      maxDuration - Maximum Duration, in ticks, of celebrating
      Returns:
      Result of Behavior
    • celebrateSurvivedRaid

      @NotNull default @NotNull BehaviorResult celebrateSurvivedRaid(int duration)
      Makes this Villager celebrate that they survived the Raid.

      This behavior does not require any memories.

      Parameters:
      duration - Duration, in ticks, of celebrating
      Returns:
      Result of Behavior
    • findJobSite

      @NotNull @NotNull BehaviorResult findJobSite(float speedMod)
      Makes this Villager find a potential Job Site.

      This behavior requires EntityMemory.JOB_SITE to be present.

      Parameters:
      speedMod - Speed Modifier while looking
      Returns:
      Result of Behavior
    • findJobSite

      default BehaviorResult findJobSite()
      Makes this Villager find a potential Job Site with the default Speed Modifier.

      This behavior requires EntityMemory.JOB_SITE to be present.

      Returns:
      Result of Behavior
    • findNearestVillage

      @NotNull @NotNull BehaviorResult findNearestVillage(int minDistance, float speedMod)
      Makes this Villager find the nearest Village.

      This method removes EntityMemory.WALKING_TARGET for you.

      Parameters:
      minDistance - Minimum Distance from Village
      speedMod - Speed Modifier while looking
      Returns:
      Result of Behavior
    • findNearestVillage

      @NotNull default @NotNull BehaviorResult findNearestVillage(int minDistance)
      Makes this Villager find the nearest Village, with no speed modifier.

      This method removes EntityMemory.WALKING_TARGET for you.

      Parameters:
      minDistance - Minimum Distance from Village
      Returns:
      Result of Behavior
    • workAtJob

      @NotNull @NotNull BehaviorResult workAtJob()
      Makes this Villager work at its Job Site.

      This behavior requires EntityMemory.JOB_SITE to be present and EntityMemory.LOOKING_TARGET to be registered.

      Returns:
      Result of Behavior
    • useBonemeal

      @NotNull @NotNull BehaviorResult useBonemeal()
      Makes this Villager use bonemeal.

      This method removes EntityMemory.LOOKING_TARGET and EntityMemory.WALKING_TARGET for you.

      Returns:
      Result of Behavior