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.

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

Returns nothing

totalActions

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

//enableDebug();
enableDebug();

Returns nothing

isNull

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

//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

max

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

Returns an int

min

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

Returns an int

pow

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

Returns a double

Global Fields

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