@minecraft/server
    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

    Methods

    • Beta

      Parameters

      • block: Block

        The block to generate loot from.

      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns undefined | 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

    • Beta

      Parameters

      Returns undefined | 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.

    • Beta

      Parameters

      • scriptBlockType: BlockType
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns undefined | 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.

    • Beta

      Parameters

      • entity: Entity
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns undefined | 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

    • Beta

      Parameters

      • entityType: EntityType
      • Optionaltool: ItemStack

        Optional. The tool to use in the looting operation.

      Returns undefined | 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.