Husbandry:KubeJS

From Harvest Festival
Jump to navigation Jump to search

Husbandry comes with support for KubeJS. You can access everything in the javascript files by starting off with the husbandry path. With an EntityJS you can obtain a IMobStatsJS by calling husbandry.getMobStats(ENTITY_JS). Keep in mind that this mob stats CAN be null as not every mob will have stats attached to them.

With this in hand you have the following methods

Name Return Type Info
getDaysBetweenProducts() int Number of days between generating products
getProduct(PlayerJS player) ListJS Generates random list of product for this mob
getMinAge() int Lifespan minimum in years
getMaxAge() int Lifespan maximum in years
getGenericTreats() int Generic treats required to level up
getSpeciesTreats() int Species treats required to level up
getDaysToBirth() int Number of days it takes to give birth
getDaysToMaturity() int Number of days it takes to reach maturity
getTreat() Item Species treat item
getMaxHappiness() int The maximum happiness this mob can have currently
getHappiness() int Current happiness value
setHappiness(int value) void Set current happiness value
decreaseHappiness(int value) void Decrease happiness value
increaseHappiness(int value) void Increase happiness value
getHappinessModifier() int Current happiness modifier
setHappinessModifier(int value) void Set current happiness value
getMaxHearts() int The maximum hearts this mob can have currently
getHearts() int The hearts this mob has currently
setHearts(int value) void Set the number of hearts this mob has
feed() void Set mob as having been fed
isHungry() boolean If the mob hasn't been fed
getHunger() int Current hunger level
isUnloved() boolean If the mob hasn't been petted/carried
setLoved() boolean Mark the mob as having been petted/carried
canProduceProduct() boolean If the mob is able to produce a product
setProduced(int amount) void Set the number of produced products for this day
resetProduct() void Reset the product count for this mob
isDomesticated() boolean If this mob has been interacted with