@minecraft
    正在准备搜索索引...

    类 LootTableManager预览版

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

    索引

    方法

    • 参数

      返回 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.

    • 参数

      • scriptBlockType: BlockType
      • 可选tool: ItemStack

        Optional. The tool to use in the looting operation.

      返回 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.

    • 参数

      • entity: Entity
      • 可选tool: ItemStack

        Optional. The tool to use in the looting operation.

      返回 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

    • 实验性

      参数

      • lootTable: LootTable
      • 可选tool: ItemStack

        Optional. The tool to use in the looting operation.

      返回 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.

    • 实验性

      参数

      • path: string

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

      返回 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.