Interface Ageable
- All Superinterfaces:
Entity, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Mob, SchedulerSource, Sound.Emitter, Sound.Source.Provider
- All Known Subinterfaces:
Animal, Chicken, Cow, CubeMob, MagmaCube, Mooshroom, Pig, Sheep, Slime, SulfurCube
A mob that is born a baby and grows up: farm animals among others.
Its age counts in ticks: negative while it is a baby, rising to 0 as it grows up;
positive for an adult that has just bred, falling to 0 before it may breed again.
Like every entity, change it from the region thread owning its chunk.
- Since:
- 0.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHow old a newborn baby is: it grows up after24000ticks, a full day. -
Method Summary
Modifier and TypeMethodDescriptionintage()Returns the age of this mob in ticks.booleanReturnstrueif this baby stopped growing up.booleanisBaby()Returnstruewhile this mob is a baby.voidsetAge(int age) Changes the age of this mob; a negative age makes it a baby.voidsetAgeLocked(boolean ageLocked) Stops this baby from growing up, or lets it grow again.voidsetBaby(boolean baby) Makes this mob a newborn baby, or an adult ready to breed.Methods inherited from interface Entity
chunk, displayName, entityId, isRemoved, location, remove, server, teleport, teleport, teleport, type, uuid, worldMethods inherited from interface HoverEventSource
asHoverEvent, asHoverEventMethods inherited from interface LivingEntity
absorptionAmount, activeEffects, addEffect, armor, armorToughness, clearEffects, damage, effect, equipment, fireTicks, hasEffect, headYaw, heal, health, isAlive, isDead, kill, knockbackResistance, maxHealth, removeEffect, setAbsorptionAmount, setFireTicks, setHeadYaw, setHealthMethods inherited from interface Mob
attackDamage, behaviour, behaviours, definition, distanceSqTo, followRange, goals, hasLineOfSightTo, height, lookAt, lookAt, movementSpeed, navigateTo, navigation, nearestPlayer, onGround, playSound, setFollowRange, setMoveSpeed, setTarget, setVelocity, target, velocityX, velocityY, velocityZ, widthMethods inherited from interface SchedulerSource
execute, execute, executeDelayed, executeDelayed, isOwnedByCurrentThreadMethods inherited from interface Sound.Source.Provider
soundSource
-
Field Details
-
BABY_START_AGE
static final int BABY_START_AGEHow old a newborn baby is: it grows up after24000ticks, a full day.- Since:
- 0.1.0
- See Also:
-
-
Method Details
-
isBaby
boolean isBaby()Returnstruewhile this mob is a baby.- Returns:
truewhile this mob is a baby- Since:
- 0.1.0
-
setBaby
void setBaby(boolean baby) Makes this mob a newborn baby, or an adult ready to breed.- Parameters:
baby-truefor a baby- Since:
- 0.1.0
-
age
int age()Returns the age of this mob in ticks.: negative while it is a baby, positive while it cannot breed again,0otherwise- Returns:
- the age of this mob in ticks
- Since:
- 0.1.0
-
setAge
void setAge(int age) Changes the age of this mob; a negative age makes it a baby.- Parameters:
age- the new age, in ticks- Since:
- 0.1.0
-
isAgeLocked
boolean isAgeLocked()Returnstrueif this baby stopped growing up., as one fed a golden dandelion does- Returns:
trueif this baby stopped growing up- Since:
- 0.1.0
-
setAgeLocked
void setAgeLocked(boolean ageLocked) Stops this baby from growing up, or lets it grow again.- Parameters:
ageLocked-trueto stop it- Since:
- 0.1.0
-