Package forestry.api.genetics
Interface IIndividualLiving
- All Superinterfaces:
IIndividual
- All Known Subinterfaces:
IBee,IButterfly
An individual with health and a lifespan.
-
Field Summary
Fields inherited from interface forestry.api.genetics.IIndividual
CAPABILITY_ID -
Method Summary
Methods inherited from interface forestry.api.genetics.IIndividual
analyze, cast, copyWithGenome, createStack, getGenome, getInactiveSpecies, getMate, getMateOptional, getSpecies, getType, hasGlint, isAnalyzed, isSecret, saveToStack, setMate
-
Method Details
-
getHealth
int getHealth()- Returns:
- Current health of the individual.
-
setHealth
void setHealth(int health) Set the current health of the individual. -
getMaxHealth
int getMaxHealth()- Returns:
- Maximum health of the individual.
-
age
void age(net.minecraft.world.level.Level level, float ageStep) Age the individual.- Parameters:
level- The world where the individual lives.ageStep- The amount to age this by. Base amount is1f, and higher values should age faster.0fshould not age, and negative values will instantly kill this individual. If given as a decimal number, the bee is aged by the whole number of steps, and has a percentage chance to age based on the decimal portion. For example, when ageStep = 2.3, the bee is aged twice, with a 30% chance to age a third time.
-
isAlive
boolean isAlive()- Returns:
- true if the individual is among the living.
-
copy
IIndividualLiving copy()Description copied from interface:IIndividualCopies this individual and all of its properties EXCEPT FOR ITS MATE. Override this method in subclasses to make sure all information is copied.- Specified by:
copyin interfaceIIndividual- Returns:
- An exact copy of this individual with NO MATE and NOT ANALYZED.
-