Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

Mod

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

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

Description

Represents a mod in the game.

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

Members

Getter
Gets the attributes that are registered under this mod's ID.
script.zs
// Mod.attributes as Collection<Attribute>
myMod.attributes

Return Type: Collection<Attribute>

attributes() as Collection<Attribute>
Gets the attributes that are registered under this mod's ID.

Returns: A list of attributes that were registered under this mod's ID.

script.zs
// Mod.attributes() as Collection<Attribute>;
myMod.attributes();

Return Type: Collection<Attribute>

Getter
Gets the blocks that are registered under this mod's ID.
script.zs
// Mod.blocks as Collection<Block>
myMod.blocks

Return Type: Collection<Block>

blocks() as Collection<Block>
Gets the blocks that are registered under this mod's ID.

Returns: A list of blocks that were registered under this mod's ID.

script.zs
// Mod.blocks() as Collection<Block>;
myMod.blocks();

Return Type: Collection<Block>

Getter
Gets the display name of this mod.
script.zs
// Mod.displayName as string
myMod.displayName

Return Type: string

displayName() as string
Gets the display name of this mod.

Returns: The display name of this mod.

script.zs
// Mod.displayName() as string;
myMod.displayName();

Return Type: string

Getter
Gets the enchantments that are registered under this mod's ID.
script.zs
// Mod.enchantments as Collection<Enchantment>
myMod.enchantments

Return Type: Collection<Enchantment>

enchantments() as Collection<Enchantment>
Gets the enchantments that are registered under this mod's ID.

Returns: A list of enchantments that were registered under this mod's ID.

script.zs
// Mod.enchantments() as Collection<Enchantment>;
myMod.enchantments();

Return Type: Collection<Enchantment>

Getter
Gets the fluids that are registered under this mod's ID.
script.zs
// Mod.fluids as Collection<Fluid>
myMod.fluids

Return Type: Collection<Fluid>

fluids() as Collection<Fluid>
Gets the fluids that are registered under this mod's ID.

Returns: A list of fluids that were registered under this mod's ID.

script.zs
// Mod.fluids() as Collection<Fluid>;
myMod.fluids();

Return Type: Collection<Fluid>

Getter
Gets the id (namespace) of this mod.
script.zs
// Mod.id as string
myMod.id

Return Type: string

id() as string
Gets the id (namespace) of this mod.

Returns: The id (namespace) of this mod.

script.zs
// Mod.id() as string;
myMod.id();

Return Type: string

Getter
Gets the items that are registered under this mod's ID.
script.zs
// Mod.items as Collection<Item>
myMod.items

Return Type: Collection<ItemDefinition>

items() as Collection<Item>
Gets the items that are registered under this mod's ID.

Returns: A list of items that were registered under this mod's ID.

script.zs
// Mod.items() as Collection<Item>;
myMod.items();

Return Type: Collection<ItemDefinition>

Getter
Gets the ItemStacks that are registered under this mod's ID.
script.zs
// Mod.itemStacks as Collection<IItemStack>
myMod.itemStacks

Return Type: Collection<IItemStack>

itemStacks() as Collection<IItemStack>
Gets the ItemStacks that are registered under this mod's ID.

Returns: A list of ItemStacks that were registered under this mod's ID.

script.zs
// Mod.itemStacks() as Collection<IItemStack>;
myMod.itemStacks();

Return Type: Collection<IItemStack>

Getter
Gets the mob effects that are registered under this mod's ID.
script.zs
// Mod.mobEffects as Collection<MobEffect>
myMod.mobEffects

Return Type: Collection<MobEffect>

mobEffects() as Collection<MobEffect>
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.

script.zs
// Mod.mobEffects() as Collection<MobEffect>;
myMod.mobEffects();

Return Type: Collection<MobEffect>

Getter
Gets the potions that are registered under this mod's ID.
script.zs
// Mod.potions as Collection<Potion>
myMod.potions

Return Type: Collection<Potion>

potions() as Collection<Potion>
Gets the potions that are registered under this mod's ID.

Returns: A list of potions that were registered under this mod's ID.

script.zs
// Mod.potions() as Collection<Potion>;
myMod.potions();

Return Type: Collection<Potion>

Getter
Gets the sound events that are registered under this mod's ID.
script.zs
// Mod.soundEvents as Collection<SoundEvent>
myMod.soundEvents

Return Type: Collection<SoundEvent>

soundEvents() as Collection<SoundEvent>
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.

script.zs
// Mod.soundEvents() as Collection<SoundEvent>;
myMod.soundEvents();

Return Type: Collection<SoundEvent>

Getter
Gets the version of this mod.
script.zs
// Mod.version as string
myMod.version

Return Type: string

version() as string
Gets the version of this mod.

Returns: The version of this mod.

script.zs
// Mod.version() as string;
myMod.version();

Return Type: string

Getter
Gets the villager professions that are registered under this mod's ID.
script.zs
// Mod.villagerProfessions as Collection<VillagerProfession>
myMod.villagerProfessions

Return Type: Collection<VillagerProfession>

villagerProfessions() as Collection<VillagerProfession>
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.

script.zs
// Mod.villagerProfessions() as Collection<VillagerProfession>;
myMod.villagerProfessions();

Return Type: Collection<VillagerProfession>