Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Slot sources

From SAS Gaming Wiki

Template:Exclusive Template:Move Template:Improve lead Template:Wip Slot sources provide any number of Minecraft:inventory slots in Minecraft:data packs via Template:Cd type Minecraft:loot table entries and in slot_source argument type of Minecraft:commandsTemplate:Upcoming.

Definition

Template:In development

Slot sources may be defined inline, or stored as Minecraft:JSON files and referenced elsewhere, as part of the data pack directory structure:

Template:Data pack directory

The root element of a slot source file can be either an Template:Nbt following the slot source structure below, or an Template:Nbt containing multiple slot sources. In the latter case all resulting slots from each source are concatenated together, acting as a shorthand for the Template:Cd type.

Format

The type values can omit or include the namespace Template:Cd, for example using the type Template:Cd or Template:Cd has the same effect.

Inventory-based types

These types select any number of slots from an inventory provided by Minecraft:loot context.

empty

Empty selection containing no slots.

slot_range

Selects slots within a slot range from the inventory of an entity or block entity. Mirrors the behavior of the item_slots used in Template:Cmd previouslyTemplate:Upcoming from the slot source.

Inheriting types

The types below restrict, merge or expand on existing slot sources.

group

Merges several slot sources into one, with the resulting selection containing all slots from each slot source provided in the order they appear in Template:Nbt. If a slot is included in more than one slot source, it will be repeated in the resulting slot source.

contents

Selects all non-emptyTemplate:Until slots from the inventory component of one or more items. If no item is stored inside that component, the resulting selection will be empty. If Template:Nbt results in more than one item with that component, the resulting selections will be concatenated as with the Template:Cd type.

filtered

Applies a filter to the selected slots, excluding any non-matching slots from the resulting selection.

limit_slots

Limits the number of slots provided, with the resulting selection containing at most that number of slots. Any slots bringing the number of slots above that limit will be excluded, in order of inclusion.

Example

Example slot source selecting every slot with more than 16 items from the hotbar and armor slots of an entity:<syntaxhighlight lang="json"> {

 "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.*"
   }
 ]

} </syntaxhighlight>

History

Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Inventarplatzquelle Minecraft:ja:スロット供与子 Minecraft:pt:Fontes de espaço Minecraft:ru:Источники слотов Minecraft:zh:槽位源