Home Commands Examples Getting Started With Scripts Global Keywords

Mod

Represents a mod in the game.

You can get a mod by using loadedMods.botania or loadedMods["botania"]

Importing the class

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.

script.zs
import crafttweaker.api.mod.Mod;

Methods

Gets the display name of this mod.

Returns: The display name of this mod.
Return Type: string

script.zs
// Mod.displayName() as string
loadedMods.botania.displayName();

Gets the attributes that are registered under this mod’s ID.

Returns: A list of attributes that were registered under this mod’s ID.
Return Type: Collection<Attribute>

script.zs
// Mod.getAttributes() as Collection<Attribute>
loadedMods.botania.getAttributes();

Gets the blocks that are registered under this mod’s ID.

Returns: A list of blocks that were registered under this mod’s ID.
Return Type: Collection<Block>

script.zs
// Mod.getBlocks() as Collection<Block>
loadedMods.botania.getBlocks();

Gets the enchantments that are registered under this mod’s ID.

Returns: A list of enchantments that were registered under this mod’s ID.
Return Type: Collection<Enchantment>

script.zs
// Mod.getEnchantments() as Collection<Enchantment>
loadedMods.botania.getEnchantments();

Gets the fluids that are registered under this mod’s ID.

Returns: A list of fluids that were registered under this mod’s ID.
Return Type: Collection<Fluid>

script.zs
// Mod.getFluids() as Collection<Fluid>
loadedMods.botania.getFluids();

Gets the ItemStacks that are registered under this mod’s ID.

Returns: A list of ItemStacks that were registered under this mod’s ID.
Return Type: Collection<IItemStack>

script.zs
// Mod.getItemStacks() as Collection<IItemStack>
loadedMods.botania.getItemStacks();

Gets the items that are registered under this mod’s ID.

Returns: A list of items that were registered under this mod’s ID.
Return Type: Collection<ItemDefinition>

script.zs
// Mod.getItems() as Collection<ItemDefinition>
loadedMods.botania.getItems();

Gets the mob effects that are registered under this mod’s ID.

Returns: A list of mob effects that were registered under this mod’s ID.
Return Type: Collection<MobEffect>

script.zs
// Mod.getMobEffects() as Collection<MobEffect>
loadedMods.botania.getMobEffects();

Gets the potions that are registered under this mod’s ID.

Returns: A list of potions that were registered under this mod’s ID.
Return Type: Collection<Potion>

script.zs
// Mod.getPotions() as Collection<Potion>
loadedMods.botania.getPotions();

Gets the sound events that are registered under this mod’s ID.

Returns: A list of sound events that were registered under this mod’s ID.
Return Type: Collection<SoundEvent>

script.zs
// Mod.getSoundEvents() as Collection<SoundEvent>
loadedMods.botania.getSoundEvents();

Gets the villager professions that are registered under this mod’s ID.

Returns: A list of villager professions that were registered under this mod’s ID.
Return Type: Collection<VillagerProfession>

script.zs
// Mod.getVillagerProfessions() as Collection<VillagerProfession>
loadedMods.botania.getVillagerProfessions();

Gets the id (namespace) of this mod.

Returns: The id (namespace) of this mod.
Return Type: string

script.zs
// Mod.id() as string
loadedMods.botania.id();

Gets the version of this mod.

Returns: The version of this mod.
Return Type: string

script.zs
// Mod.version() as string
loadedMods.botania.version();

Properties

NameTypeHas GetterHas SetterDescription
Name
attributes
Type
Collection<Attribute>
Has Getter
true
Has Setter
false
Description
Gets the attributes that are registered under this mod’s ID.
Name
blocks
Type
Collection<Block>
Has Getter
true
Has Setter
false
Description
Gets the blocks that are registered under this mod’s ID.
Name
displayName
Type
string
Has Getter
true
Has Setter
false
Description
Gets the display name of this mod.
Name
enchantments
Type
Collection<Enchantment>
Has Getter
true
Has Setter
false
Description
Gets the enchantments that are registered under this mod’s ID.
Name
fluids
Type
Collection<Fluid>
Has Getter
true
Has Setter
false
Description
Gets the fluids that are registered under this mod’s ID.
Name
id
Type
string
Has Getter
true
Has Setter
false
Description
Gets the id (namespace) of this mod.
Name
itemStacks
Type
Collection<IItemStack>
Has Getter
true
Has Setter
false
Description
Gets the ItemStacks that are registered under this mod’s ID.
Name
items
Type
Collection<ItemDefinition>
Has Getter
true
Has Setter
false
Description
Gets the items that are registered under this mod’s ID.
Name
mobEffects
Type
Collection<MobEffect>
Has Getter
true
Has Setter
false
Description
Gets the mob effects that are registered under this mod’s ID.
Name
potions
Type
Collection<Potion>
Has Getter
true
Has Setter
false
Description
Gets the potions that are registered under this mod’s ID.
Name
soundEvents
Type
Collection<SoundEvent>
Has Getter
true
Has Setter
false
Description
Gets the sound events that are registered under this mod’s ID.
Name
version
Type
string
Has Getter
true
Has Setter
false
Description
Gets the version of this mod.
Name
villagerProfessions
Type
Collection<VillagerProfession>
Has Getter
true
Has Setter
false
Description
Gets the villager professions that are registered under this mod’s ID.