Script API - v1.21.110.26
    Preparing search index...

    Class LootTableManagerRc

    Manager for Loot Table related APIs. Allows for generation of drops from blocks and entities according to their loot tables.

    Index

    Constructors

    Methods

    • Parameters

      • block: Block

        The block to generate loot from.

      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block.

      Generates loot from a given block as if it had been mined.

      Throws if the block is in an unloaded chunk, or if the block's position is outside of world bounds.

      LocationInUnloadedChunkError

      LocationOutOfWorldBoundariesError

      UnloadedChunksError

    • Parameters

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block.

      Generates loot from a given block permutation as if it had been mined.

    • Parameters

      • scriptBlockType: BlockType
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block.

      Generates loot from a given block type as if it had been mined.

    • Parameters

      • entity: Entity
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the entity was invalid.

      Generates loot from given a entity as if it had been killed.

      This function can throw errors.

      InvalidEntityError

    • Parameters

      • entityType: EntityType
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped.

      Generates loot from given a entity type as if it had been killed.

    • Beta

      Parameters

      • lootTable: LootTable
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns ItemStack[]

      An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block.

      Generates loot from a given LootTable.

    • Beta

      Parameters

      • path: string

        Path to the table to retrieve. Does not include file extension, or 'loot_tables/' folder prefix. Example: entities/creeper.

      Returns LootTable

      Returns a LootTable if one is found, or undefined if the provided path does not correspond to an existing loot table.

      Retrieves a single loot table from the level's current registry.