LootTableManager
Manager for loot tables.
An instance of this manager can be obtained via the 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!
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.
Enum Constants
LootTableManager is an enum. It has 1 enum constants. They are accessible using the code below.
Methods
Gets the ids of all registered loot tables.
Returns: The ids of all registered loot tables.
Return Type: Set<ResourceLocation>
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.
Return Type: LootTable
Parameter | Type | Description |
---|---|---|
Parameter name | Type ResourceLocation | Description The name of the table to get. |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name ids | Type Set<ResourceLocation> | Has Getter true | Has Setter false | Description Gets the ids of all registered loot tables. |