Таблицы добычи - это технические таблицы 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:.
- A 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.
- A function.
- 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.
- A function.
- 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.
- A function.
- 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
- A function.
- 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
- A function.
- 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
- A function.
- 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.
- A function.
- 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.
- A function.
- 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.
- A function.
- 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).
Список таблиц добычи
Below is a list of all loot tables that exist by default. More tables can be added in the world save for use with custom maps.
- loot_tables
- blocks - Шаблон:Upcoming
- chests - Items from loot chests
- abandoned_mineshaft - Minecarts with chests found in abandoned mineshafts
- buried_treasure - Chests found by following buried treasure explorer maps
- desert_pyramid - Chests found in the treasure room inside desert temples
- end_city_treasure - Chests found in End cities
- igloo_chest - The chest that appears in the basements in igloos
- jungle_temple - Chests found inside jungle temples
- jungle_temple_dispenser - Dispensers found inside jungle temples
- nether_bridge - Chests found in Nether fortresses
- shipwreck_map - Chests found in shipwrecks that can include a treasure map
- shipwreck_supply - Supply chests found in shipwrecks
- shipwreck_treasure - Treasure chests found in shipwrecks
- simple_dungeon - Dungeon chests
- spawn_bonus_chest - Bonus chests that appear in a new world when bonus chests are enabled
- stronghold_corridor - Chests found on slab altars in corridors in strongholds
- stronghold_crossing - The chest in the upper level of store rooms in strongholds
- stronghold_library - Chests found in a library in strongholds
- underwater_ruin_big - Chests found in the big variant of underwater ruins
- underwater_ruin_small - Chests found in the small variant of underwater ruins
- village_blacksmith - The chest found in the Blacksmith's house in a village
- woodland_mansion - chests found in a woodland mansion.
- entities - Items dropped from entities. May cause issues when applied to chests, due to some items spawning in stacks of 0
- sheep - Sheep with wool
- black
- blue
- brown
- cyan
- gray
- green
- light_blue
- light_gray
- lime
- magenta
- orange
- pink
- purple
- red
- white
- yellow
- armor_stand Шаблон:Upcoming
- bat
- blaze
- cat Шаблон:Upcoming
- cat_morning_gift Шаблон:Upcoming
- 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 - Mooshroom
- ocelot
- pandaШаблон:Upcoming
- parrot
- phantom
- player Шаблон:Upcoming
- pig
- polar bear
- pufferfish
- rabbit
- salmon
- sheep - Sheep without wool, also inherited by sheep with wool
- shulker
- silverfish
- skeleton
- skeleton_horse
- slime
- snow_golem
- spider
- squid
- tropical_fish
- vex
- villager
- vindicator
- witch
- wither Шаблон:Upcoming
- wither_skeleton
- wolf
- zombie
- zombie_horse
- zombie_pigman
- zombie_villager
- sheep - Sheep with wool
- gameplay
- fishing
- fish - Also inherited by guardians and elder guardians
- junk
- treasure
- fishing - Used to determine loot from fishing by loading the three tables from the fishing folder and applying luck to each one
- fishing
- empty - Contains no items
Пользовательские карты
Custom maps can use loot tables to change what loot will spawn in containers or drop by mobs. They can either change existing loot tables or create new ones. This is the file structure: Пользовательские карты могут использовать таблицы дропа, изменить какой дроп будет появляться в контейнерах или дропаться мобов. Авторы пользовательских карт могут либо изменить существующие таблицы добычи, либо создать новые.
Файловая структура:
- Каталог сохранения мира
- 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 | Dinnerbone announces loot tables. | ||||
| [[|]] | Added loot tables. | ||||
| [[|]] | Added condition entity_scores. | ||||
| [[|]] | Renamed "villager_golem.json" to "iron_golem.json" | ||||
| Added fishing loot tables, sheep without wool, and zombie and skeleton horses. | |||||
| Renamed the tag item: to name:, and the tag items: to entries: | |||||
| Added the tag type: and support to load a loot table instead of an item. | |||||
| Added the tag luck: to default files, though it currently does nothing in the code. | |||||
| Added the function set_damage | |||||
| [[|]] | Added the function enchant_randomly and set_attributes. | ||||
| [[|]] | Added the quality tag. | ||||
| Removed luck and luck_multiplier tags. | |||||
| Added the bonus_rolls tag. | |||||
| [[|]] | A player in spectator mode will no longer trigger a container to use its loot table to generate loot. | ||||
| 1.9.1 | Loot tables now work with dispensers and droppers. | ||||
Added default table chests/jungle_temple_dispenser. | |||||
| 1.11 | 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 | ||||
| 1.11 | Villagers, vexes and ender dragons are now able to draw from their own loot tables | ||||
| 1.13 | Custom loot tables have been moved into data packs. | ||||
| java upcoming | |||||
| 1.14 | Block drops changed to use loot tables too. | ||||
| 1.14 | Added loot tables for cat, cat_morning_gift, player, wither. | ||||
| 1.14 | Added loot tables for new blocks. | ||||
Issues
Шаблон:Issue list