Таблицы добычи - это технические таблицы 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.
- A condition
- 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.
- A condition
- type: Type of entry. Can be
itemfor item entries,loot_tableto produce items from another loot table, oremptyfor 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 byfunctions, 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.
- For type 'item', ID name of the item to be produced, e.g.
- functions: For type 'item', applies functions to the item stack being produced. Functions are applied in order, so for example
looting_enchantmust be afterset_countto work correctly. - 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
weightbased on the killing/opening/fishing player's luck attribute. Formula isfloor( weight + (quality * generic.luck)).
- conditions: Determines conditions for this entry to be used. If multiple conditions are specified, all must pass.
- An entry
- conditions: Determines conditions for this pool to be used. If multiple conditions are specified, all must pass.
- A pool
- 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.
Функции
Loot tables use various functions to change the item stack being produced, such as adjusting the stack size or adding enchantments. Below are a list of valid functions, and the tags used by them. The tags are placed in the same function object as function:.
- Функция
- function: "enchant_randomly" - Enchants the item with one randomly-selected enchantment. The level of the enchantment, if applicable, will be random.
- enchantments: List of enchantment names to choose from. If omitted, all enchantments applicable to the item will be possible.
- Функция
- 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/locatecommand (case insensitive). - decoration: The icon used to mark the destination on the map. Accepts any of the map icon text IDs (case insensitive). If
mansionormonumentis 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_propertiescondition to cook food from animals on death.
- function: "furnace_smelt" - Smelts the item as it would be in a furnace. Used in combination with the
- Функция
- function: "looting_enchant" - Adjusts the stack size based on the level of the Looting enchantment on the
killerentity. - 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: "looting_enchant" - Adjusts the stack size based on the level of the Looting enchantment on the
- Функция
- 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.
- A modifier
- Функция
- 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
thisto use the entity that died,killerfor the killer, orkiller_playerfor a killer that is a player. - properties: Properties to be checked.
- on_fire: Test whether the entity is or is not on fire.
- entity: Specifies the entity to check for the condition. Set to
- entity_scores - Test the scoreboard scores of an entity.
- entity: Specifies the entity to check for the condition. Set to
thisto use the entity that died,killerfor the killer, orkiller_playerfor 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.
- entity: Specifies the entity to check for the condition. Set to
- killed_by_player - Test if a
killer_playerentity is available.- inverse: If true, the condition passes if
killer_playeris not available.
- inverse: If true, the condition passes if
- 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
killerentity.- chance: Base success rate.
- looting_multiplier: Looting adjustment to the base success rate. Formula is
chance + (looting_level * looting_multiplier).
Список таблиц дропа
Ниже приведен список всех таблиц дропа, которые существуют по умолчанию.
Дополнительные таблицы могут быть добавлены в сохраненном мире для использования с пользовательскими картами.
- loot_tables
- blocks
- chests - Предметы для сундука с дропом
- abandoned_mineshaft - Вагонетка с сундуком найденная в шахте
- buried_treasure - Сундуки сокровищниц найденные при помощи карты сокровищницы
- desert_pyramid - Сундуки найденные внутри сокровищницы храма в пустыне
- end_city_treasure - Сундук найденный в городе Края
- igloo_chest - Сундуки, которые появляются в подвале иглу
- jungle_temple - Сундуки найденные внутри храма джунглей
- jungle_temple_dispenser - Выбрасыватель найденные внутри храме джунглей
- nether_bridge - Сундук найденный в адской крепости
- shipwreck_map - Сундуки найденные в кораблекрушении, которые могут содержать внутри сокровищницы карту сокровищниц
- shipwreck_supply - Сундуки найденные в кораблекрушении
- shipwreck_treasure - Сундуки с сокровищами найденные в кораблекрушении
- simple_dungeon - Сундуки найденные в сокровищнице
- spawn_bonus_chest - Бонусный сундук, который появляется в новом мире, если появление бонусного сундука включено
- stronghold_corridor - Сундуки найденные на алтаре из плит в коридорах крепости
- stronghold_crossing - Сундуки найденные на вернем уровне комнаты хранения крепости
- stronghold_library - Сундуки найденные в библиотеке крепости
- underwater_ruin_big - Сундуки найденные в большом варианте подводных руин
- underwater_ruin_small - Сундуки найденные в малом варианте подводных руин
- village_blacksmith - Сундуки найденные в кузнеце деревни
- woodland_mansion - сундуки найденные в лесном особняке.
- 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
- sheep - Овцы с шерстью
- gameplay
- fishing
- fish - Также унаследованный от стража и древнего стража
- junk
- treasure
- fishing - Используется для определения дропа от рыбалки, загружая три таблицы из папки рыбалки, применяя удачу каждому из них
- fishing
- empty - Не содержит элементов, пустой элемент
Пользовательские карты
Пользовательские карты могут использовать таблицы дропа, изменить какой дроп будет появляться в контейнерах или дропаться мобов. Авторы пользовательских карт могут либо изменить существующие таблицы добычи, либо создать новые.
Файловая структура:
- Каталог сохранения мира
- datapacks
- data pack
- data
- minecraft
- loot_tables
- loot table name.json
- loot_tables
- custom directory
- loot_tables
- loot table name.json
- loot_tables
- minecraft
- data
- data pack
- datapacks
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.9 | October 19, 2015 | Dinnerbone анонсировал таблицы дропа. | |||
| 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.1 | pre1 | Теперь таблицы дропа работают с раздатчиком и выбрасывателем. | |||
Добавлена таблица по умолчанию chests/jungle_temple_dispenser. | |||||
| 1.11 | 16w32a | Donkey, mule, husk and zombie villager now each draw from their own loot tables, rather than drawing from the horse and zombie loot tables, respectively | |||
| 16w43a | Villagers, vexes and ender dragons are now able to draw from their own loot tables | ||||
| 1.13 | 17w43a | Настраиваемые таблицы лута были перенесены в набор данных. | |||
| Запланированные версии Java Edition | |||||
| 1.14 | 18w43a | Выпадение блоков изменено и для таблиц дропа. | |||
| 18w44a | Добавлены таблицы дропа для котов, утренних подарков котов, игроков, Иссушителя. | ||||
| 18w44a | Добавлены таблицы дропа для новых блоков. | ||||
Проблемы
Отчёты об ошибках, связанных с «INFSCI/Черновики/Loot Table», поддерживаются в системе отслеживания ошибок Mojira. Сообщайте о найденных ошибках там (на английском языке).