接口 Ageable
- 所有超级接口:
Attributable
,CommandSender
,Creature
,Damageable
,Entity
,LivingEntity
,Metadatable
,Nameable
,Permissible
,ProjectileSource
,ServerOperator
- 所有已知子接口:
AbstractHorse
,Animals
,ChestedHorse
,Chicken
,Cow
,Donkey
,Horse
,Llama
,Mule
,MushroomCow
,Ocelot
,Parrot
,Pig
,PolarBear
,Rabbit
,Sheep
,SkeletonHorse
,Villager
,Wolf
,ZombieHorse
代表一个有年龄和繁殖能力的实体.
-
方法概要
修饰符和类型方法说明boolean
canBreed()
返回动物是否具有繁殖能力.int
getAge()
获取这只动物的年龄.boolean
获取这个动物的年龄是否被锁定.boolean
isAdult()
获取这个动物是否成年.void
setAdult()
设置这只动物为成年状态.void
setAge
(int age) 设置这只动物的年龄.void
setAgeLock
(boolean lock) 锁定这只动物的年龄,设置这个将防止动物从长成以准备进行交配.void
setBaby()
设置这只动物为年幼状态.void
setBreed
(boolean breed) 设置动物是否具有繁殖能力,如果动物是年幼的设置此将立即长大.从接口继承的方法 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.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
-
方法详细资料
-
getAge
int getAge()获取这只动物的年龄.原文: Gets the age of this animal.
- 返回:
- 年龄
-
setAge
void setAge(int age) 设置这只动物的年龄.原文: Sets the age of this animal.
- 参数:
age
- 新的年龄
-
setAgeLock
void setAgeLock(boolean lock) 锁定这只动物的年龄,设置这个将防止动物从长成以准备进行交配.原文: Lock the age of the animal, setting this will prevent the animal from maturing or getting ready for mating.
- 参数:
lock
- 是否锁定
-
getAgeLock
boolean getAgeLock()获取这个动物的年龄是否被锁定.原文: Gets the current agelock.
- 返回:
- 这个动物的年龄是否被锁定
-
setBaby
void setBaby()设置这只动物为年幼状态.原文: Sets the age of the animal to a baby
-
setAdult
void setAdult()设置这只动物为成年状态.原文: Sets the age of the animal to an adult
-
isAdult
boolean isAdult()获取这个动物是否成年.原文: Returns true if the animal is an adult.
- 返回:
- 如果动物成年,则返回true
-
canBreed
boolean canBreed()返回动物是否具有繁殖能力.原文: Return the ability to breed of the animal.
- 返回:
- 动物是否具有繁殖能力
-
setBreed
void setBreed(boolean breed) 设置动物是否具有繁殖能力,如果动物是年幼的设置此将立即长大.原文: Set breedability of the animal, if the animal is a baby and set to breed it will instantly grow up.
- 参数:
breed
- 动物是否具有繁殖能力
-