Home Commands Examples Getting Started With Scripts Global Keywords
Generic Recipe Manipulation

CTTickFunction

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.

script.zs
import mods.pmmo.CTTickFunction;

Methods

This function represents the logic being executed for a perk during the tick stage. If a perk has a duration, this will execute each tick. the number of ticks elapsed is included to allow for tracking duration between executions.

Returns: output data. not all events use output data, and your perk may not have anything to return. In this case an empty map is sufficient.
Return Type: MapData

script.zs
CTTickFunction.apply(player as Player, nbt as MapData, ticksElapsed as int) as MapData
ParameterTypeDescription
Parameter
player
Type
Player
Description
perk executor
Parameter
nbt
Type
MapData
Description
data provided by PMMO
Parameter
ticksElapsed
Type
int
Description
the current number of elapsed ticks