Minecraft Wiki
Advertisement

Таблицы добычи - это технические таблицы JSON, которые отражают, какие предметы должны быть в естественно генерируемых контейнерах, какие предметы должны упасть при убийстве моба, или какие предметы можно выловить или что произойдет, когда блок сломан.

Использование

Таблицы добычи структурированы как тег String, который определяет используемую таблицу, и длинный тег, определяющий сид. Контейнеры или мобы с одинаковыми сидами и таблицами будут иметь одни и те же предметы. Таблицы добычи не определяют, какой слот контейнера используется; т.е определяется случайным образом на основе сида.

Для Сундуков, Сундуков-ловушек, Загрузочных воронок, Вагонеток с сундуком, Вагонеток с воронкой, Раздатчиков, Выбрасывателей, и Шалкеровых ящиков:

    •  LootTable:Таблица добычи, которая будет использоваться для заполнения контейнера при его следующем открытии или при взаимодействии с элементами. Когда контейнер представляет собой сундук, который является частью двойного сундука, будет затронута только половина, соответствующая помеченному одиночному сундуку.
    •  LootTableSeed: Сид для генерации таблицы дропа. Работает аналогично сидам для миров. 0 или пропуск будет использовать случайное начальное число.

Эти теги будут удалены после взаимодействия с предметами (путем открытия контейнера, прерывания контейнера и т. д.), и только после этого предметы будут помещены в контейнер.

Для мобов:

  • Корневой тег.
    •  DeathLootTable: Таблица дропа, которая будет использоваться для предметов, которые выпадают при убийстве сущности.
    •  DeathLootTableSeed: Сид для генерации таблицы дропа. Работает аналогично сидам для миров. 0 или пропуск будет использовать случайное начальное число.

Таблицы дропа мобов и контейнеров могут быть изменены с помощью команд /entitydata, /blockdata, /execute store и /data merge. Вы также можете предоставить таблицу дропа сущности или сбросить ее в мире с помощью команды /drop

Теги

Loot tables are defined using the JSON format. Below are a list of tags used.

  •  The root tag
    •  pools: A list of all pools for this entity. Each pool used will generate items from its list of items based on the number of rolls. Pools are applied in order.
      •  A pool
        •  conditions: Determines conditions for this pool to be used. If multiple conditions are specified, all must pass.
          •  A condition
            •  condition: Name of condition. Valid conditions are described below.
        •  rolls: Specifies the exact number of rolls on the pool.
        •  rolls: Specifies a random number of rolls within a range.
          •  min: Minimum number of rolls. Inclusive.
          •  max: Maximum number of rolls. Inclusive.
        •  bonus_rolls: Specifies the exact number of bonus rolls on the pool per point of luck. Rounded down after multiplying.
        •  bonus_rolls: Specifies a random number of bonus rolls within a range. Rounded down after multiplying.
          •  min: Minimum number of bonus rolls. Inclusive.
          •  max: Maximum number of bonus rolls. Inclusive.
        •  entries: A list of all things that can be produced by this pool. One entry is chosen per roll as a weighted random selection from all entries without failing conditions.
          •  An entry
            •  conditions: Determines conditions for this entry to be used. If multiple conditions are specified, all must pass.
              •  A condition
                •  condition: Name of condition. Valid conditions are described below.
            •  type: Type of entry. Can be item for item entries, loot_table to produce items from another loot table, or empty for an entry that generates nothing.
            •  name:
              • For type 'item', ID name of the item to be produced, e.g. minecraft:diamond. The default, if not changed by functions, is a stack of 1 of the default instance of the item.
              • For type 'loot_table', loot table to be used, e.g. minecraft:gameplay/fishing/junk.
            •  functions: For type 'item', applies functions to the item stack being produced. Functions are applied in order, so for example looting_enchant must be after set_count to work correctly.
              •  A function:
                •  function: Name of the function to apply. Valid functions are described below.
                •  conditions: Determines conditions for this function to be applied. If multiple conditions are specified, all must pass.
                  •  A condition
                    •  condition: Name of condition. Valid conditions are described below.
            •  weight: Determines how often this entry will be chosen out of all the entries in the pool. Entries with higher weights will be used more often (chance is Шаблон:Frac).
            •  quality: Modifies the entry's weight based on the killing/opening/fishing player's luck attribute. Formula is floor( weight + (quality * generic.luck)).

Функции

Таблицы дропа используют различные функции для изменения создаваемого стека предметов, такие как регулировка размера стека или добавление чар.

Ниже приведен список допустимых функций и используемые ими теги. Теги размещаются в том же объекте функции, что и  function:

  • Функция.
    •  function: "enchant_randomly" - Зачаровывает предмет с помощью одного случайно выбранного зачаровывания. Уровень зачаровывания, если применимо, будет случайным.
    •  enchantments: Список измен зачаровываний. Если этот параметр опущен, будут доступны все чары, применимые к предмету.
  • Функция.
    •  function: "enchant_with_levels" - Enchants the item, with the specified enchantment level (roughly equivalent to using an enchantment table at that level).
    •  treasure: Determines whether treasure enchantments are allowed on this item.
    •  levels: Specifies the exact enchantment level to use.
    •  levels: Specifies a random enchantment level within a range.
      •  min: Minimum level to use.
      •  max: Maximum level to use.
  • Функция.
    •  function: "exploration_map" - Converts an empty map into an explorer map leading to a nearby generated structure.
    •  destination: The type of generated structure to locate. Accepts any of the StructureTypes used by the /locate command (case insensitive).
    •  decoration: The icon used to mark the destination on the map. Accepts any of the map icon text IDs (case insensitive). If mansion or monument is used, the color of the lines on the item texture will change to match the corresponding explorer map.
    •  zoom: The zoom level of the resulting map. Defaults to 2.
    •  search_radius: The size, in chunks, of the area to search for structures. The area checked is square, not circular. Radius 0 causes only the current chunk to be searched, radius 1 causes the current chunk and eight adjacent chunks to be searched, and so on. Defaults to 50.
    •  skip_existing_chunks: Don't search in chunks that have already been generated. Defaults to true.
  • Функция.
    •  function: "furnace_smelt" - Smelts the item as it would be in a furnace. Used in combination with the entity_properties condition to cook food from animals on death.
  • Функция.
    •  function: "looting_enchant" - Adjusts the stack size based on the level of the Looting enchantment on the killer entity.
    •  count: Specifies an exact number of additional items per level of looting.
    •  count: Specifies a random number (within a range) of additional items per level of looting. Note the random number generated may be fractional, and will be rounded after multiplying by the looting level.
      •  min: Minimum increase.
      •  max: Maximum increase.
    •  limit: Specifies the maximum amount of items in the stack after the looting calculation. If the value is 0, no limit is applied.
  • Функция.
    •  function: "set_attributes" - Add attribute modifiers to the item.
    •  modifiers
      •  A modifier
        •  name: Name of the modifier.
        •  attribute: The name of the attribute this modifier is to act upon.
        •  operation: Must be either "addition", "multiply_base" or "multiply_total".
        •  amount: Specifies the exact amount of change of the modifier.
        •  amount: Specifies a random amount within a range.
          •  min: Minimum amount.
          •  max: Maximum amount.
        •  id: Optional : UUID of the modifier following. If none specified, a new UUID will be generated.
        •  slot: Slots the item must be in for the modifier to take effect, this value can be one of the following : "mainhand", "offhand", "feet", "legs", "chest", or "head".
        •  slot: One of the listed slots will be chosen randomly.
  • Функция.
    •  function: "set_count" - Sets the stack size.
    •  count: Specifies the exact stack size to set.
    •  count: Specifies a random stack size within a range.
      •  min: Minimum stack size.
      •  max: Maximum stack size.
  • Функция.
    •  function: "set_damage" - Sets the item's damage value (durability) for tools.
    •  damage: Specifies the damage fraction to set (1.0 is undamaged, 0.0 is zero durability left).
    •  damage: Specifies a random damage fraction within a range.
      •  min: Minimum value.
      •  max: Maximum value.
  • Функция.
    •  function: "set_name" - Adds display name of the item.
    •  name: A simple name like with an anvil.
    •  name: A JSON text component name, allowing color, translations, etc.
  • Функция.
    •  function: "set_nbt" - Adds NBT data to the item.
    •  tag: Tag string to add, similar to those used by commands. Note that the first bracket is required and quotation marks need to be escaped using a backslash (\).

Условия

Loot tables use various conditions which add requirements to a drop, pool, or function. Below are a list of valid conditions, and the tags used by them. The tags are placed in the same condition object as  condition:.

  • entity_properties - Test properties of an entity.
    •  entity: Specifies the entity to check for the condition. Set to this to use the entity that died, killer for the killer, or killer_player for a killer that is a player.
    •  properties: Properties to be checked.
      •  on_fire: Test whether the entity is or is not on fire.
  • entity_scores - Test the scoreboard scores of an entity.
    •  entity: Specifies the entity to check for the condition. Set to this to use the entity that died, killer for the killer, or killer_player for a killer that is a player.
    •  scores: Scores to check. All specified scores must pass for the condition to pass.
      •  A score: Key name is the objective while the value is the exact score value required for the condition to pass.
      •  A score: Key name is the objective while the value specifies a range of score values required for the condition to pass.
        •  min: Minimum score.
        •  max: Maximum score.
  • killed_by_player - Test if a killer_player entity is available.
    •  inverse: If true, the condition passes if killer_player is not available.
  • random_chance - Test if a random number 0.0–1.0 is less than a specified value.
    •  chance: Success rate as a number 0.0–1.0.
  • random_chance_with_looting - Test if a random number 0.0–1.0 is less than a specified value, affected by the level of Looting on the killer entity.
    •  chance: Base success rate.
    •  looting_multiplier: Looting adjustment to the base success rate. Formula is chance + (looting_level * looting_multiplier).

Список таблиц дропа

Ниже приведен список всех таблиц дропа, которые существуют по умолчанию.

Дополнительные таблицы могут быть добавлены в сохраненном мире для использования с пользовательскими картами.

  • loot_tables
    • blocks
    • chests - Предметы для сундука с дропом
    • entities - Предметы, выпавшие из сущности. Может вызвать проблемы при применении к сундукам, из-за некоторых предметов появляющихся в нулевых стеках
      • sheep - Овцы с шерстью
        • black
        • blue
        • brown
        • cyan
        • gray
        • green
        • light_blue
        • light_gray
        • lime
        • magenta
        • orange
        • pink
        • purple
        • red
        • white
        • yellow
      • armor_stand
      • bat
      • blaze
      • cat
      • cat_morning_gift
      • cave_spider
      • chicken
      • cod
      • cow
      • creeper
      • donkey
      • dolphin
      • drowned
      • elder_guardian
      • ender_dragon
      • enderman
      • endermite
      • evoker
      • ghast
      • giant
      • guardian
      • horse
      • husk
      • iron_golem
      • llama
      • magma_cube
      • mule
      • mushroom_cow
      • ocelot
      • panda
      • parrot
      • phantom
      • player
      • pig
      • polar bear
      • pufferfish
      • rabbit
      • salmon
      • sheep - Овцы без шерсти, также унаследованные овцами с шерстью
      • shulker
      • silverfish
      • skeleton
      • skeleton_horse
      • slime
      • snow_golem
      • spider
      • squid
      • tropical_fish
      • vex
      • villager
      • vindicator
      • witch
      • wither
      • wither_skeleton
      • wolf
      • zombie
      • zombie_horse
      • zombie_pigman
      • zombie_villager
    • gameplay
      • fishing
      • fishing - Используется для определения дропа от рыбалки, загружая три таблицы из папки рыбалки, применяя удачу каждому из них
    • empty - Не содержит элементов, пустой элемент

Пользовательские карты

Основная статья: Команды консоли/datapack

Пользовательские карты могут использовать таблицы дропа, изменить какой дроп будет появляться в контейнерах или дропаться мобов. Авторы пользовательских карт могут либо изменить существующие таблицы добычи, либо создать новые.

Файловая структура:

  • Каталог сохранения мира
    • datapacks
      • data pack
        • data
          • minecraft
            • loot_tables
              • loot table name.json
          • custom directory
            • loot_tables
              • loot table name.json

The JSON files go in this folder. For example, the file for zombies would go in datapacks/pack name/data/minecraft/loot_tables/entities/zombie.json. This will make every zombie in that world use your loot table rather than the default zombie loot table. To add custom loot tables, create a new file in a new directory. Then, summon the mob with the data tag DeathLootTable set to the name of the directory and file (without the .json extension), such as DeathLootTable:"customdirectory:path/to/table".

История

Официальный выпуск Java Edition
1.9October 19, 2015Dinnerbone анонсировал таблицы дропа.
15w43aБыли добавлены таблицы дропа
15w43bДобавлено состояние entity_scores.
15w43cПереименование "villager_golem.json" в "iron_golem.json"
Добавлены таблицы дропа для рыболовли, овец без шерсти, зомби и лошади-скелета.
Переименован тег  item: в  name:, а тег  items: в  entries:
Добавлен тег  type: и поддержка загрузки таблиц дропа вместо предметов.
Добавлен тег  luck: к файлам по умолчанию, хотя он ничего не делает в коде.
Добавлена функция set_damage
15w44aДобавлена функция enchant_randomly и set_attributes.
15w44bДобавлен тег  quality.
Удален тег  luck и  luck_multiplier.
Добавлен тег  bonus_rolls.
15w51aИгрок в режиме наблюдения больше не может инициировать контейнер используя свою таблицу дропа для генерации дропа.
1.9.1pre1Теперь таблицы дропа работают с раздатчиком и выбрасывателем.
Добавлена таблица по умолчанию chests/jungle_temple_dispenser.
1.1116w32aDonkey, mule, husk and zombie villager now each draw from their own loot tables, rather than drawing from the horse and zombie loot tables, respectively
16w43aVillagers, vexes and ender dragons are now able to draw from their own loot tables
1.1317w43aНастраиваемые таблицы лута были перенесены в набор данных.
Запланированные версии Java Edition
1.1418w43aВыпадение блоков изменено и для таблиц дропа.
18w44aДобавлены таблицы дропа для котов, утренних подарков котов, игроков, Иссушителя.
18w44aДобавлены таблицы дропа для новых блоков.

Проблемы

Отчёты об ошибках, связанных с «INFSCI/Черновики/Loot Table», поддерживаются в системе отслеживания ошибок Mojira. Сообщайте о найденных ошибках там (на английском языке).

Advertisement