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

LootTableManager

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.loot.table.LootTableManager;

Description

Manager for loot tables.

An instance of this manager can be obtained via the com.blamejared.crafttweaker.api.loot.LootManager.


These methods can only be called from the server side, so ensure that all calls are inside a level.isClientSide check or a #onlyIf side server preprocessor!

Members

getTable(name as ResourceLocation) as LootTable
Gets a table with the given name.

If no table is registered with the name, an empty table will be returned.

Returns: The found table or an empty table if not found.

script.zs
// LootTableManager.getTable(name as ResourceLocation) as LootTable;
myLootTableManager.getTable(<resource:minecraft:gameplay/cat_morning_gift>);

Parameters:

name Type: ResourceLocation - The name of the table to get.

Return Type: LootTable

Getter
Gets the ids of all registered loot tables.
script.zs
// LootTableManager.ids as Set<ResourceLocation>
myLootTableManager.ids

Return Type: Set<ResourceLocation>

ids() as Set<ResourceLocation>
Gets the ids of all registered loot tables.

Returns: The ids of all registered loot tables.

script.zs
// LootTableManager.ids() as Set<ResourceLocation>;
myLootTableManager.ids();

Return Type: Set<ResourceLocation>