In this post, I’ll walk you through what Procedures and Functions are in Visual Bukkit 6, how they work, and how to use them effectively — complete with some cool examples. We’ll also take a look at arguments, which let you customize their behavior.
Explanation
In Visual Bukkit, Procedures and Functions help you write cleaner, more organized code by reusing logic. While they serve a similar purpose, there’s one key difference:
- A Procedure performs a task but doesn’t return a result.
- A Function, on the other hand, returns a value (using the “Function Return” block).
Think of a procedure like a robot that completes a task and then stops. A Function is more like a calculator which does something and then gives you a result.
Arguments
Sometimes you’ll want to pass information into your Procedure or Function. That’s where arguments come in.
Imagine a blender (your Procedure or Function) and the ingredients (your arguments). The code is your smoothie recipe. You feed in ingredients, the blender runs, and you get your result.
You can access arguments in two ways:
- As individual arguments (e.g.,
P. Argument
orF. Argument
) using an index. - As a list of arguments (
P. Arguments
orF. Arguments
).
Remember: the index starts at 0, just like any list.
Triggering Procedures and Functions
- Use the green “Execute Procedure” block to run a Procedure.
- Use the orange “Function Value” block to call a Function and get its return value.
Adding a Procedure or Function
Creating one is just like adding a command or GUI:
- Click Add Component.
- Choose Procedure or Function.
- Inside, write any code you like!
Examples:
Procedure:


If you want another example containing procedures, check out my video about GUIs.
Function:
When doing /command 3 (Command argument 0) 2 (Command Argument 1), the result will be 6.


Leave a Reply