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.
//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
instanceof
entity instanceof IEntity;Returns a boolean
max
//max(int number1, int number2);max(10, 11);Returns the larger number
min
//min(int number1, int number2);min(10, 11);Returns the lower number
pow
//pow(double number1, double number2);pow(2.0, 4.0);Returns a double
Global Fields
| Field | Description | 
|---|---|
| Fieldbrewing | DescriptionAccesses the Brewing Handler | 
| Fieldclient | DescriptionAccesses client Methods | 
| Fieldevents | DescriptionAccesses the Event Handler | 
| Fieldformat | DescriptionAccesses the Formatting Handler | 
| Fieldfurnace | DescriptionAccesses the Furnace Handler | 
| Fieldgame | DescriptionAccesses Game functions | 
| FielditemUtils | DescriptionAccesses the ItemUtils Handler | 
| FieldloadedMods | DescriptionAccesses the loaded Mods list | 
| Fieldlogger | DescriptionAccesses the logger | 
| FieldoreDict | DescriptionAccesses the oreDictionary Handler | 
| Fieldrecipes | DescriptionAccesses the Recipe Handler | 
| Fieldserver | DescriptionAccesses server Methods | 
| Fieldvanilla | DescriptionAccesses vanilla functions (currently only vanilla.seeds available) |