Global Functions

Link to global-functions

Global functions are functions that can be called without being imported.
Here's the list:

Prints the string to the crafttweaker log as information.

ZenScript
Copy
//print(String message);
print("Hello World!");

Returns nothing

ZenScript
Copy
//totalActions();
totalActions();

Returns an int that shows how many global functions are registered.

Enables Debug mode.
Use of the Debug Preprocessor is preferred though.

ZenScript
Copy
//enableDebug();
enableDebug();

Returns nothing

Checks if a given object is null.
Doesn't work on primitives!

ZenScript
Copy
//isNull(Object o);
isNull(<minecraft:dirt>);

Returns a boolean Note: If this does not work for you, try casting the object to bool <minecraft:dirt> as bool

ZenScript
Copy
entity instanceof IEntity;

Returns a boolean

ZenScript
Copy
//max(int number1, int number2);
max(10, 11);

Returns the larger number

ZenScript
Copy
//min(int number1, int number2);
min(10, 11);

Returns the lower number

ZenScript
Copy
//pow(double number1, double number2);
pow(2.0, 4.0);

Returns a double

FieldDescrizione
Field
brewing
Descrizione
Accesses the Brewing Handler
Field
client
Descrizione
Accesses client Methods
Field
events
Descrizione
Accesses the Event Handler
Field
format
Descrizione
Accesses the Formatting Handler
Field
furnace
Descrizione
Accesses the Furnace Handler
Field
game
Descrizione
Accesses Game functions
Field
itemUtils
Descrizione
Accesses the ItemUtils Handler
Field
loadedMods
Descrizione
Accesses the loaded Mods list
Field
logger
Descrizione
Accesses the logger
Field
oreDict
Descrizione
Accesses the oreDictionary Handler
Field
recipes
Descrizione
Accesses the Recipe Handler
Field
server
Descrizione
Accesses server Methods
Field
vanilla
Descrizione
Accesses vanilla functions (currently only vanilla.seeds available)