Skip to main content

MxtCultivation: Cultivation and Breakthroughs

MxtCultivation does two things: it adds to the cultivation progress of a resource, and it attempts a breakthrough along that resource's realm chain. A breakthrough runs the same server flow cultivation and events use.

Methods​

MethodParametersReturn valueDescription
add(entity, resource, amount)LivingEntity, resource ID, finite non-negative numberbooleanAdds to the cultivation progress of that resource. On the client, with an unknown resource, a negative number or a non-finite number it returns false.
tryBreakthrough(entity, resource)LivingEntity, resource IDCultivationService.BreakthroughResultAttempts a breakthrough along the realm chain of that resource.

The accessors of the breakthrough record are advanced(), failure(), failedResource() and costs(). It fires the normal cultivationBreak flow, breakthrough actions, particles, tribulations and associated abilities.

const result = MxtCultivation.tryBreakthrough(player, 'mxt:spirit_power')
if (!result.advanced()) console.warn(`breakthrough refused: ${result.failure()}`)