接口 Villager
- 所有超级接口:
AbstractVillager,Ageable,Attributable,Breedable,CommandSender,Creature,Damageable,Entity,InventoryHolder,Leashable,LivingEntity,Lootable,Merchant,Metadatable,Mob,Nameable,NPC,Permissible,PersistentDataHolder,ProjectileSource,ServerOperator
-
嵌套类概要
嵌套类修饰符和类型接口说明static interface表示村民可能拥有的各种不同职业。static interface声誉变更原因。static interface用于八卦中的声誉类型。static interface表示村民类型,通常对应它们生成的生物群系。从接口继承的嵌套类/接口 org.bukkit.entity.Entity
Entity.Spigot -
方法概要
修饰符和类型方法说明voidaddReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount) 向给定实体添加给定类型的声誉。voidaddReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount, @NotNull Villager.ReputationEvent changeReason) 向给定实体添加给定类型的声誉,并指定更改原因。long获取此村民的声誉衰减时间。获取此村民的当前职业。intgetReputation(@NotNull UUID uuid) 获取实体的声誉。intgetReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType) 获取实体对给定类型的声誉。int获取此村民的交易经验。int获取此村民的等级。获取此村民的当前类型。intgetWeightedReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType) 获取实体对给定类型的加权声誉。voidremoveReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount) 移除给定实体给定类型的声誉。voidremoveReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount, @NotNull Villager.ReputationEvent changeReason) 移除给定实体给定类型的声誉,并指定更改原因。voidsetGossipDecayTime(long ticks) 设置此村民的声誉衰减时间。voidsetProfession(@NotNull Villager.Profession profession) 设置此村民的新职业。voidsetReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount) 设置给定实体给定类型的声誉。voidsetReputation(@NotNull UUID uuid, @NotNull Villager.ReputationType reputationType, int amount, @NotNull Villager.ReputationEvent changeReason) 设置给定实体给定类型的声誉,并指定更改原因。voidsetVillagerExperience(int experience) 设置此村民的交易经验。voidsetVillagerLevel(int level) 设置此村民的等级。void设置此村民的新类型。void让此村民摇头。boolean尝试让此村民在给定位置睡觉。voidwakeup()如果此村民正在睡觉,则唤醒他。zombify()将此村民转换为僵尸村民,就像被僵尸杀死一样。从接口继承的方法 org.bukkit.entity.AbstractVillager
getInventory从接口继承的方法 org.bukkit.attribute.Attributable
getAttribute从接口继承的方法 org.bukkit.entity.Breedable
canBreed, getAgeLock, setAgeLock, setBreed从接口继承的方法 org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage从接口继承的方法 org.bukkit.entity.Damageable
damage, damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealth从接口继承的方法 org.bukkit.entity.Entity
addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport从接口继承的方法 org.bukkit.entity.Leashable
getLeashHolder, isLeashed, setLeashHolder从接口继承的方法 org.bukkit.entity.LivingEntity
addPotionEffect, addPotionEffect, addPotionEffects, attack, canBreatheUnderwater, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getCanPickupItems, getCategory, getCollidableExemptions, getDeathSound, getDrinkingSound, getEatingSound, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getFallDamageSound, getFallDamageSoundBig, getFallDamageSoundSmall, getHurtSound, getItemInUse, getItemInUseTicks, getKiller, getLastDamage, getLastTwoTargetBlocks, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoActionTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlockExact, getTargetBlockExact, getWaypointColor, getWaypointStyle, hasAI, hasLineOfSight, hasPotionEffect, isClimbing, isCollidable, isGliding, isInvisible, isRiptiding, isSleeping, isSwimming, playHurtAnimation, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setArrowCooldown, setArrowsInBody, setCanPickupItems, setCollidable, setGliding, setInvisible, setItemInUseTicks, setLastDamage, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoActionTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setRiptiding, setSwimming, setWaypointColor, setWaypointStyle, swingMainHand, swingOffHand从接口继承的方法 org.bukkit.loot.Lootable
getLootTable, getSeed, setLootTable, setSeed从接口继承的方法 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.persistence.PersistentDataHolder
getPersistentDataContainer从接口继承的方法 org.bukkit.projectiles.ProjectileSource
launchProjectile, launchProjectile从接口继承的方法 org.bukkit.permissions.ServerOperator
isOp, setOp
-
方法详细资料
-
getProfession
获取此村民的当前职业。- 返回:
- 当前职业。
原文:Gets the current profession of this villager.
-
setProfession
设置此村民的新职业。- 参数:
profession- 新职业。原文:Sets the new profession of this villager.
profession- New profession.
-
getVillagerType
获取此村民的当前类型。- 返回:
- 当前类型。
原文:Gets the current type of this villager.
-
setVillagerType
设置此村民的新类型。- 参数:
type- 新类型。原文:Sets the new type of this villager.
type- New type.
-
getVillagerLevel
int getVillagerLevel()获取此村民的等级。 等级为1且没有经验的村民可能会失去其职业。- 返回:
- 此村民的等级
原文:Gets the level of this villager. A villager with a level of 1 and no experience is liable to lose its profession.
-
setVillagerLevel
void setVillagerLevel(int level) 设置此村民的等级。 等级为1且没有经验的村民可能会失去其职业。- 参数:
level- 新等级level- the new level- 抛出:
IllegalArgumentException- 如果等级不在[1, 5]范围内原文:Sets the level of this villager. A villager with a level of 1 and no experience is liable to lose its profession.
IllegalArgumentException- if level not between [1, 5]
-
getVillagerExperience
int getVillagerExperience()获取此村民的交易经验。- 返回:
- 交易经验
原文:Gets the trading experience of this villager.
-
setVillagerExperience
void setVillagerExperience(int experience) 设置此村民的交易经验。- 参数:
experience- 新经验experience- new experience- 抛出:
IllegalArgumentException- 如果经验 < 0原文:Sets the trading experience of this villager.
IllegalArgumentException- if experience < 0
-
sleep
尝试让此村民在给定位置睡觉。
该位置必须在当前世界中,并且在该位置放置了床。村民在睡觉时会将头放在指定的方块上。- 参数:
location- 床的位置location- the location of the bed- 返回:
- 睡觉是否成功
原文:Attempts to make this villager sleep at the given location.
The location must be in the current world and have a bed placed at the location. The villager will put its head on the specified block while sleeping.
-
wakeup
void wakeup()如果此村民正在睡觉,则唤醒他。- 抛出:
IllegalStateException- 如果没有在睡觉原文:Causes this villager to wake up if he's currently sleeping.
IllegalStateException- if not sleeping
-
shakeHead
void shakeHead()让此村民摇头。原文:Causes this villager to shake his head.
-
zombify
将此村民转换为僵尸村民,就像被僵尸杀死一样。 注意:这将触发EntityTransformEvent- 返回:
- 转换后的实体
ZombieVillager,如果转换被取消则返回null原文:Convert this Villager into a ZombieVillager as if it was killed by a Zombie. Note: this will fire a EntityTransformEvent
-
getReputation
int getReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType) 获取实体对给定类型的声誉。- 参数:
uuid- 正在检查声誉的实体的UUIDreputationType- 要获取的声誉类型uuid- the UUID of the entity whose reputation is being checkedreputationType- reputation type to be retrieved- 返回:
- 给定声誉类型的当前声誉
原文:Gets the reputation of an entity for a given type.
-
getWeightedReputation
int getWeightedReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType) 获取实体对给定类型的加权声誉。实体的总声誉是其每种类型加权声誉的总和,其中声誉乘以分配给其类型的权重。
- 参数:
uuid- 正在检查声誉的实体的UUIDreputationType- 要获取的声誉类型uuid- the UUID of the entity whose reputation is being checkedreputationType- reputation type to be retrieved- 返回:
- 给定声誉类型的当前声誉
- 另请参阅:
-
getReputation
获取实体的声誉。- 参数:
uuid- 正在检查声誉的实体的UUIDuuid- the UUID of the entity whose reputation is being checked- 返回:
- 给定声誉类型的当前声誉
原文:Gets the reputation of an entity.
-
addReputation
void addReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount) 向给定实体添加给定类型的声誉。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在添加声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要添加的声誉数量原文:Add reputation of a given type towards a given entity.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being addedreputationType- reputation type to be modifiedamount- amount of reputation to add
-
addReputation
void addReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount, @NotNull @NotNull Villager.ReputationEvent changeReason) 向给定实体添加给定类型的声誉,并指定更改原因。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在添加声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要添加的声誉数量changeReason- 声誉更改原因原文:Add reputation of a given type towards a given entity, with a specific change reason.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being addedreputationType- reputation type to be modifiedamount- amount of reputation to addchangeReason- reputation change reason
-
removeReputation
void removeReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount) 移除给定实体给定类型的声誉。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在移除声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要移除的声誉数量原文:Remove reputation of a given type towards a given entity.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being removedreputationType- reputation type to be modifiedamount- amount of reputation to remove
-
removeReputation
void removeReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount, @NotNull @NotNull Villager.ReputationEvent changeReason) 移除给定实体给定类型的声誉,并指定更改原因。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在移除声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要移除的声誉数量changeReason- 声誉更改原因原文:Remove reputation of a given type towards a given entity, with a specific change reason.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being removedreputationType- reputation type to be modifiedamount- amount of reputation to removechangeReason- reputation change reason
-
setReputation
void setReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount) 设置给定实体给定类型的声誉。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在添加声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要添加的声誉数量原文:Set reputation of a given type towards a given entity.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being addedreputationType- reputation type to be modifiedamount- amount of reputation to add
-
setReputation
void setReputation(@NotNull @NotNull UUID uuid, @NotNull @NotNull Villager.ReputationType reputationType, int amount, @NotNull @NotNull Villager.ReputationEvent changeReason) 设置给定实体给定类型的声誉,并指定更改原因。最终值将被限制在所提供声誉类型支持的最大值内。如果最终值低于声誉丢弃阈值,则与此声誉类型相关的八卦将被移除。
注意:这将触发
VillagerReputationChangeEvent。- 参数:
uuid- 正在添加声誉的实体的UUIDreputationType- 要修改的声誉类型amount- 要添加的声誉数量changeReason- 声誉更改原因原文:Set reputation of a given type towards a given entity, with a specific change reason.
The final value will be clamped to the maximum value supported by the provided reputation type. If the final value is below the reputation discard threshold, gossip associated with this reputation type will be removed.
Note: this will fire a
VillagerReputationChangeEvent.uuid- the UUID of the entity for whom the reputation is being addedreputationType- reputation type to be modifiedamount- amount of reputation to addchangeReason- reputation change reason
-
setGossipDecayTime
void setGossipDecayTime(long ticks) 设置此村民的声誉衰减时间。默认为24000(1个昼夜周期)。
- 参数:
ticks- 村民声誉衰减的刻数原文:Sets the reputation decay time for this villager.
Defaults to 24000 (1 daylight cycle).
ticks- amount of ticks until the villager's reputation decays
-
getGossipDecayTime
long getGossipDecayTime()获取此村民的声誉衰减时间。默认为24000(1个昼夜周期)。
- 返回:
- 村民声誉衰减的刻数
原文:Gets the reputation decay time for this villager.
Defaults to 24000 (1 daylight cycle).
-