Skip to content

Functions and Processes

Amp63 edited this page Dec 22, 2025 · 3 revisions

Creating Functions and Processes

To create a function or process, start the template with function or process:

# Function that gives a player 64 golden apples
from dfpyre import *

Function('giveApples', codeblocks=[
    PlayerAction.GiveItems(Item('golden_apple', 64))
])

Calling Functions and Processes

To call a function or process, use the call_function or start_process functions with the name of the function or process:

from dfpyre import *

PlayerEvent.Join([
    CallFunction('giveApples'),
    StartProcess('playerLoop')
])