Interface VillagerBehavior
- All Superinterfaces:
CreatureBehavior, EntityBehavior
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull BehaviorResultcelebrateSurvivedRaid(int duration) Makes this Villager celebrate that they survived the Raid.@NotNull BehaviorResultcelebrateSurvivedRaid(int minDuration, int maxDuration) Makes this Villager celebrate that they survived the Raid.default BehaviorResultMakes this Villager find a potential Job Site with the default Speed Modifier.@NotNull BehaviorResultfindJobSite(float speedMod) Makes this Villager find a potential Job Site.default @NotNull BehaviorResultfindNearestVillage(int minDistance) Makes this Villager find the nearest Village, with no speed modifier.@NotNull BehaviorResultfindNearestVillage(int minDistance, float speedMod) Makes this Villager find the nearest Village.@NotNull BehaviorResultgiftHero(int duration) Makes this Villager gift the hero of the Raid.@NotNull BehaviorResultMakes this Villager harvest Farmland.@NotNull BehaviorResultResets this Villager's profession.default @NotNull BehaviorResultshowTrades(int duration) Makes this Village show trades to a Player.@NotNull BehaviorResultshowTrades(int minDuration, int maxDuration) Makes this Villager show trades to a Player.@NotNull BehaviorResultMakes this Villager use bonemeal.@NotNull BehaviorResultMakes this Villager work at its Job Site.Methods inherited from interface CreatureBehavior
followTemptation, followTemptation, followTemptation, panic, panic, tryFindWater, tryFindWaterMethods inherited from interface EntityBehavior
backupIfClose, backupIfClose, eraseIf, interactWithDoor, jumpOnBed, jumpOnBed, meleeAttack, meleeAttack, moveToWantedItem, moveToWantedItem, moveToWantedItem, passiveIf, reactToBell, ringBell, sleep, socializeAtBell, wakeUp
-
Method Details
-
harvestFarmland
Makes this Villager harvest Farmland.This behavior requires
EntityMemory.LOOKING_TARGETandEntityMemory.WALKING_TARGETto be absent, andEntityMemory.SECONDARY_JOB_SITEto be present.- Returns:
- Result of Behavior
-
showTrades
Makes this Villager show trades to a Player.This behavior requires
EntityMemory.INTERACTION_TARGETto be present.- Parameters:
minDuration- Minimum Duration, in ticks, of showingmaxDuration- Maximum Duration, in ticks, of showing- Returns:
- Result of Behavior
-
showTrades
Makes this Village show trades to a Player.This behavior requires
EntityMemory.INTERACTION_TARGETto be present.- Parameters:
duration- How long to show trades, in ticks- Returns:
- Result of Behavior
-
resetProfession
Resets this Villager's profession.This method removes
EntityMemory.JOB_SITEfor you.- Returns:
- Result of Behavior
-
giftHero
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_PLAYERto be present.- Parameters:
duration- Duration, in ticks, of gifting- Returns:
- Result of Behavior
-
celebrateSurvivedRaid
Makes this Villager celebrate that they survived the Raid.This behavior does not require any memories.
- Parameters:
minDuration- Minimum Duration, in ticks, of celebratingmaxDuration- Maximum Duration, in ticks, of celebrating- Returns:
- Result of Behavior
-
celebrateSurvivedRaid
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
Makes this Villager find a potential Job Site.This behavior requires
EntityMemory.JOB_SITEto be present.- Parameters:
speedMod- Speed Modifier while looking- Returns:
- Result of Behavior
-
findJobSite
Makes this Villager find a potential Job Site with the default Speed Modifier.This behavior requires
EntityMemory.JOB_SITEto be present.- Returns:
- Result of Behavior
-
findNearestVillage
Makes this Villager find the nearest Village.This method removes
EntityMemory.WALKING_TARGETfor you.- Parameters:
minDistance- Minimum Distance from VillagespeedMod- Speed Modifier while looking- Returns:
- Result of Behavior
-
findNearestVillage
Makes this Villager find the nearest Village, with no speed modifier.This method removes
EntityMemory.WALKING_TARGETfor you.- Parameters:
minDistance- Minimum Distance from Village- Returns:
- Result of Behavior
-
workAtJob
Makes this Villager work at its Job Site.This behavior requires
EntityMemory.JOB_SITEto be present andEntityMemory.LOOKING_TARGETto be registered.- Returns:
- Result of Behavior
-
useBonemeal
Makes this Villager use bonemeal.This method removes
EntityMemory.LOOKING_TARGETandEntityMemory.WALKING_TARGETfor you.- Returns:
- Result of Behavior
-