Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

Global Functions

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

print

Prints the string to the crafttweaker log as information.

script.zs
//print(String message);
print("Hello World!");

Returns nothing

totalActions

script.zs
//totalActions();
totalActions();

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

enableDebug

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

script.zs
//enableDebug();
enableDebug();

Returns nothing

isNull

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

script.zs
//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

instanceof

script.zs
entity instanceof IEntity;

Returns a boolean

max

script.zs
//max(int number1, int number2);
max(10, 11);

Returns the larger number

min

script.zs
//min(int number1, int number2);
min(10, 11);

Returns the lower number

pow

script.zs
//pow(double number1, double number2);
pow(2.0, 4.0);

Returns a double

Global Fields

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