public interface Villager extends Ageable, NPC, InventoryHolder
| Modifier and Type | Interface and Description | 
|---|---|
static class  | 
Villager.Profession
Represents the various different Villager professions there may be. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
Inventory | 
getInventory()
Gets this villager's inventory. 
 | 
Villager.Profession | 
getProfession()
Gets the current profession of this villager. 
 | 
MerchantRecipe | 
getRecipe(int i)
Get the recipe at a certain index of this villager's trade list. 
 | 
int | 
getRecipeCount()
Get the number of trades this villager currently has available. 
 | 
List<MerchantRecipe> | 
getRecipes()
Get a list of trades currently available from this villager. 
 | 
int | 
getRiches()
Gets this villager's riches, the number of emeralds this villager has
 been given. 
 | 
HumanEntity | 
getTrader()
Gets the player this villager is trading with, or null if it is not
 currently trading. 
 | 
boolean | 
isTrading()
Gets whether this villager is currently trading. 
 | 
void | 
setProfession(Villager.Profession profession)
Sets the new profession of this villager. 
 | 
void | 
setRecipe(int i,
         MerchantRecipe recipe)
Set the recipe at a certain index of this villager's trade list. 
 | 
void | 
setRecipes(List<MerchantRecipe> recipes)
Set the list of trades currently available from this villager. 
 | 
void | 
setRiches(int riches)
Sets this villager's riches. 
 | 
canBreed, getAge, getAgeLock, isAdult, setAdult, setAge, setAgeLock, setBaby, setBreed_INVALID_getLastDamage, _INVALID_setLastDamage, addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlock, hasAI, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isLeashed, removePotionEffect, setAI, setCanPickupItems, setCollidable, setGliding, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAwaygetAttribute_INVALID_damage, _INVALID_damage, _INVALID_getHealth, _INVALID_getMaxHealth, _INVALID_setHealth, _INVALID_setMaxHealth, damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealthlaunchProjectile, launchProjectileVillager.Profession getProfession()
void setProfession(Villager.Profession profession)
profession - New profession.List<MerchantRecipe> getRecipes()
void setRecipes(List<MerchantRecipe> recipes)
recipes - a list of recipesMerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException
i - the indexIndexOutOfBoundsExceptionvoid setRecipe(int i,
               MerchantRecipe recipe)
        throws IndexOutOfBoundsException
i - the indexrecipe - the recipeIndexOutOfBoundsExceptionint getRecipeCount()
Inventory getInventory()
getInventory in interface InventoryHolderboolean isTrading()
HumanEntity getTrader()
int getRiches()
void setRiches(int riches)
riches - the new richesgetRiches()Copyright © 2021. All rights reserved.