全局函数
全局函数是不需要导入就可以调用的函数。 这是列表:
print
将字符串信息打印到CraftTweaker的日志中。
//print(字符串信息);
print("Hello World!");
不返回任何内容。
totalActions
//totalActions();
totalActions();
返回一个int,显示注册了多少个全局函数。
enableDebug
启用调试模式。 不过,最好还是用调试预处理器。
//enableDebug();
enableDebug();
不返回任何内容。
isNull
检查给定对象是否为空。 对数据类型无效!
//isNull(Object o);
isNull(<minecraft:dirt>);
返回一个boolean
注意:如果这个函数对您不起作用,请尝试将对象转换为bool
<minecraft:dirt> as bool
instanceof(类型判断)
entity instanceof IEntity;
返回一个boolean
max
//max(int number1, int number2);
max(10, 11);
返回更大的那个数字
min
//min(int number1, int number2);
min(10, 11);
返回更小的那个数字
pow(次方)
//pow(double number1, double number2);
pow(2.0, 4.0);
返回一个double
全局字段
字段
描述
brewing
client
events
format
furnace
game
itemUtils
loadedMods
logger
请访问logger
oreDict
recipes
server
vanilla
请访问原版函数(目前仅vanilla.seeds可用)
Last updated