-
Notifications
You must be signed in to change notification settings - Fork 0
Lua Block
kyfex_uwu edited this page Mar 31, 2023
·
1 revision
The Lua Block is a technical block that functions similarly to a command block: just like you write a command for a command block to execute, you can write Lua code in a Lua Block. This code runs when it is loaded, whether that is loading a world, dimension, or chunk, and it only runs one time. However, if you declare either a clientTick
function or a serverTick
function, these functions will run every tick on either the client or the server.
Inside the Lua Block, you can access all APIs you can in a regular script. There is also a global variable self
that can be accessed, and it's set to the Lua Block itself.
Just like a command block, the Lua Block can only be accessed and modified by a player that is creative level two.