接口 Villager
- 所有超级接口:
Ageable
,Attributable
,CommandSender
,Creature
,Damageable
,Entity
,InventoryHolder
,LivingEntity
,Merchant
,Metadatable
,Nameable
,NPC
,Permissible
,ProjectileSource
,ServerOperator
Represents a villager NPC
-
嵌套类概要
嵌套类修饰符和类型接口说明static enum
The Career of this Villager.static enum
Represents the various different Villager professions there may be. -
方法概要
修饰符和类型方法说明Get the currentVillager.Career
for this Villager.Gets this villager's inventory.Gets the current profession of this villager.int
Gets this villager's riches, the number of emeralds this villager has been given.void
setCareer
(Villager.Career career) Set the newVillager.Career
for this Villager.void
setCareer
(Villager.Career career, boolean resetTrades) Set the newVillager.Career
for this Villager.void
setProfession
(Villager.Profession profession) Sets the new profession of this villager.void
setRiches
(int riches) Sets this villager's riches.从接口继承的方法 org.bukkit.entity.Ageable
canBreed, getAge, getAgeLock, isAdult, setAdult, setAge, setAgeLock, setBaby, setBreed
从接口继承的方法 org.bukkit.attribute.Attributable
getAttribute
从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage
从接口继承的方法 org.bukkit.entity.Damageable
damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth
从接口继承的方法 org.bukkit.entity.Entity
addPassenger, addScoreboardTag, eject, getEntityId, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, setVelocity, teleport, teleport, teleport, teleport
从接口继承的方法 org.bukkit.entity.LivingEntity
addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, hasAI, hasLineOfSight, hasPotionEffect, isCollidable, isGliding, isLeashed, removePotionEffect, setAI, setCanPickupItems, setCollidable, setGliding, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway
从接口继承的方法 org.bukkit.inventory.Merchant
getRecipe, getRecipeCount, getRecipes, getTrader, isTrading, setRecipe, setRecipes
从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.Nameable
getCustomName, setCustomName
从接口继承的方法 org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
从接口继承的方法 org.bukkit.projectiles.ProjectileSource
launchProjectile, launchProjectile
从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
-
方法详细资料
-
getProfession
Villager.Profession getProfession()Gets the current profession of this villager.- 返回:
- Current profession.
-
setProfession
Sets the new profession of this villager.- 参数:
profession
- New profession.
-
getCareer
Villager.Career getCareer()Get the currentVillager.Career
for this Villager.- 返回:
- the
Villager.Career
-
setCareer
Set the newVillager.Career
for this Villager. This method will reset the villager's trades to the new career.- 参数:
career
- the new career, or null to clear the career to a random one- 抛出:
IllegalArgumentException
- when the newVillager.Career
cannot be used with this Villager's currentVillager.Profession
.
-
setCareer
Set the newVillager.Career
for this Villager.- 参数:
career
- the new career, or null to clear the career to a random oneresetTrades
- true to reset this Villager's trades to the new career's (if any)- 抛出:
IllegalArgumentException
- when the newVillager.Career
cannot be used with this Villager's currentVillager.Profession
.
-
getInventory
Inventory getInventory()Gets this villager's inventory.
Note that this inventory is not the Merchant inventory, rather, it is the items that a villager might have collected (from harvesting crops, etc.) 获取该对象的用户界面项目.原文:Get the object's inventory.
- 指定者:
getInventory
在接口中InventoryHolder
- 返回:
- The inventory.
-
getRiches
int getRiches()Gets this villager's riches, the number of emeralds this villager has been given.- 返回:
- the villager's riches
-
setRiches
void setRiches(int riches) Sets this villager's riches.- 参数:
riches
- the new riches- 另请参阅:
-