Event
A hook for a certain event in Minecraft
This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.
You may register functions to one, and those functions will be called when the event occurs
register()
Register a function on this event
Functions are run in registration order
An optional string argument can be given, grouping functions under that name, for an easier management later on
- Overload 1
- Overload 2
Example:
events.TICK:register(function() end, "Name")
clear()
Clears the given event of all its functions
clear()
Returns:
Type | Description |
---|---|
nil | - |
Example:
events.TICK:clear()
remove()
Removes either a function from this event or when given a string, remove all functions registered under that name
Returns the number of functions that were removed
- Overload 1
- Overload 2
Example:
events.TICK:remove("Name")
getRegisteredCount()
Returns the number of functions that are registered with the given name
getRegisteredCount(name)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | String | - | - |
Returns:
Type | Description |
---|---|
Integer | - |
Example:
events.TICK:getRegisteredCount("Name")