![]() |
VOOZH | about |
Slot sources allow the location of any inventory slot to be specified within data packs.
Slot sources are JSON objects, with the following fields.
type: the slot source type.<type-specific>: additional fields depending on the type.minecraft:empty Type
minecraft:group Type
[a, b] + [c, a] -> [a, b, c, a]terms: list of slot sources to join.minecraft:slot_range Type
from argument of the /item command.source: an entity or block entity from which the slots will be sourced, from loot context.
block_entity, this, attacking_entity, last_damage_player, direct_attacker, target_entity, or interacting_entityslots: a slot range in the format of <slot_type> or <slot_type>.<slot_number> (e.g. armor.chest or container.*).minecraft:contents Type
minecraft:group type.Bundle [a, b] + Shulker Box [c, d] -> [a, b, c, d]component: the inventory component to target.
minecraft:bundle_contents, minecraft:charged_projectiles, and minecraft:containerslot_source: a slot source containing slots with item(s) to target.minecraft:filtered Type
item_filter: an item predicate to match against the items in each slot.slot_source: the slot source to filter.minecraft:limit_slots Type
[a, b, c, d] -> [a, b, c] if the limit is set to 3limit: integer, the maximum number of slots to include in the resulting selection.slot_source: the slot source to limit.{ "type":"minecraft:filtered", "item_filter":{ "count":{ "min":16 } }, "slot_source":[ { "type":"minecraft:slot_range", "source":"this", "slots":"hotbar.*" }, { "type":"minecraft:slot_range", "source":"this", "slots":"armor.*" } ] }
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.21.11 | 25w44a | Added slot sources. | |||||
| Upcoming Java Edition | |||||||
| 26.3 | snapshot1 | Slot sources can now be defined as files inside a datapack, within the slot_source folder. | |||||
minecraft:contents is no longer restricted to only selecting non-empty slots. | |||||||
Added minecraft:reference | |||||||
Changed minecraft:slot_range. | |||||||