接口 Villager
- 所有超级接口:
Ageable,Attributable,CommandSender,Creature,Damageable,Entity,InventoryHolder,LivingEntity,Merchant,Metadatable,Nameable,NPC,Permissible,ProjectileSource,ServerOperator
Represents a villager NPC
-
嵌套类概要
嵌套类修饰符和类型接口说明static enumThe Career of this Villager.static enumRepresents the various different Villager professions there may be. -
方法概要
修饰符和类型方法说明Get the currentVillager.Careerfor this Villager.Gets this villager's inventory.Gets the current profession of this villager.intGets this villager's riches, the number of emeralds this villager has been given.voidsetCareer(Villager.Career career) Set the newVillager.Careerfor this Villager.voidsetCareer(Villager.Career career, boolean resetTrades) Set the newVillager.Careerfor this Villager.voidsetProfession(Villager.Profession profession) Sets the new profession of this villager.voidsetRiches(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.Careerfor this Villager.- 返回:
- the
Villager.Career
-
setCareer
Set the newVillager.Careerfor 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.Careercannot be used with this Villager's currentVillager.Profession.
-
setCareer
Set the newVillager.Careerfor 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.Careercannot 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- 另请参阅:
-