ModInfo

保存已加载模组的信息

导入相关包

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.mods.ModInfo;

参数

名称类型可获得可设置描述
blocksstdlib.List<MCBlock>truefalseFinds all blocks registered for that mod.
displayNamestringtruefalseGets the display name of the mod
实体类型stdlib.List<MCEntityType>truefalseFinds all EntityTypes registered for that mod
fluidsstdlib.List<MCFluid>truefalseFinds all EntityTypes registered for that mod
itemsstdlib.List<IItemStack>truefalseGets all known items from that mod

Does not take "sub items" into account!
That means, that it will e.g. find an enchanted book, but without tags, and only one!
modidstringtruefalseGets the modid of the mod
命名空间stringtruefalseGets the namespace of the mod
versionstringtruefalseGets the version of the mod