Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.entity.type.animal.Animal;

Extending AgeableMob

Link to extending-ageablemob

Animal extends AgeableMob. That means all methods available in AgeableMob are also available in Animal

Name: canMate

Return Type: boolean

ZenScript
Copy
Animal.canMate(other as Animal) as boolean
ParameterType
Parameter
other
Type
Animal

Link to finalizeSpawnChildFromBreeding

Name: finalizeSpawnChildFromBreeding

ZenScript
Copy
Animal.finalizeSpawnChildFromBreeding(level as ServerLevel, otherParent as Animal, child as AgeableMob?)
ParameterType
Parameter
level
Type
ServerLevel
Parameter
otherParent
Type
Animal
Parameter
child
Type
AgeableMob?

Name: isFood

Return Type: boolean

ZenScript
Copy
Animal.isFood(stack as ItemStack) as boolean
ParameterType
Parameter
stack
Type
ItemStack

Name: resetLove

ZenScript
Copy
// Animal.resetLove()

myAnimal.resetLove();

Name: setInLove

ZenScript
Copy
Animal.setInLove(loveCause as Player?)
ParameterTypeOptional
Parameter
loveCause
Type
Player?
Optional
true

Link to spawnChildFromBreeding

Name: spawnChildFromBreeding

ZenScript
Copy
Animal.spawnChildFromBreeding(level as ServerLevel, otherParent as Animal)
ParameterType
Parameter
level
Type
ServerLevel
Parameter
otherParent
Type
Animal
NameTypeHas GetterHas Setter
Name
canFAllInLove
Type
boolean
Has Getter
true
Has Setter
false
Name
inLoveTime
Type
Animal
Has Getter
true
Has Setter
true
Name
isInLove
Type
boolean
Has Getter
true
Has Setter
false
Name
loveCause
Type
ServerPlayer?
Has Getter
true
Has Setter
false