Skip to content

Calling a Function

LucFr edited this page Jan 23, 2023 · 1 revision

Calling a function is like using an effect. But if the function has the ability to return something, can also be used like an expression.

functionName(parameters)

  • Parameters can be replicated using commas or "and".
    • The type can be plural (eg. number -> numbers, entity -> entities) to allow multiple values in one parameter.
  • To enter a raw list for a parameter, it must be in parentheses. Otherwise, it might conflict with other function parameters as both use commas and "and". This is not needed if the function has only one parameter.

Example:

functionName(parameter1, (value1, value2 and value3), parameter3)

Of course, if the list comes from a variable or an expression this is not needed. For example {list::*} or all players can be entered for the parameter directly.

  • Calling a function inside of another function is possible. It is also possible to call the function from inside of itself (this is called recursion)!

📜 Wiki Navigation


  • ❓ What is Minecraft?
  • ❓ What is coding?
  • ❓ What is program language?
  • ❓ Why is coding Minecraft?
  • ❓ What needs to be prepared?
  • ❓ What needs to do while coding?

📖 Tutorials

Minecraft Server setup

Skript coding

Project setup

📃 Other Info

Clone this wiki locally