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

    Class LootTableManagerBeta

    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.