Loot pool entry

Helpers that build a minecraft:loot_pool_entry object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

Alternatives

Alternatives

Uses the first child whose conditions pass, and ignores the rest.

Alternatives(children, modifier?, condition?)
children
list of LootPoolEntry (at least 1)

The entries to try, in order.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Dynamic

Dynamic

Drops a block's own contents: contents for a shulker box's items, sherds for a decorated pot's sherds.

Dynamic(name, weight?, quality?, modifier?, condition?)
name
DynamicDrops

Which contents to drop.

weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Empty

Empty

Gives nothing. Give it a weight to make a pool sometimes drop nothing.

Empty(weight?, quality?, modifier?, condition?)
weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

LootTable maybe {
  pools = [Pool(1, [Item(name = diamond), Empty().Weight(4)])]
}

Group

Group

Uses every child whose conditions pass.

Group(children, modifier?, condition?)
children
list of LootPoolEntry (at least 1)

The entries to use.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Item

Item

Gives one item. A plain item id where an entry is expected does the same thing.

Item(name, weight?, quality?, modifier?, condition?)
name
item id

The item.

weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

LootTable gems {
  pools = [Pool(1, [Item(name = diamond).Weight(1), Item(name = emerald).Weight(3)])]
}

LootTable

LootTable

Rolls another loot table and gives what it drops.

LootTable(value, expand?, weight?, quality?, modifier?, condition?)
value
LootTableListRef

The loot table, by id, or a table written inline.

expandoptional
bool

If true, each of the loot tables becomes an independent entry in the pool with the same weight and quality. If false, drops all loot tables. Defaults to false.

weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Sequence

Sequence

Uses children in order until one's conditions fail.

Sequence(children, modifier?, condition?)
children
list of LootPoolEntry (at least 1)

The entries to use, in order.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Slots

Slots

Gives items taken from slots of an entity or container, picked by a slot source.

Slots(slot_source, weight?, quality?, modifier?, condition?)
slot_source
SlotSource
weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.

Tag

Tag

Gives items from an item tag: all of them, or with expand, one picked at random. A #tag where an entry is expected does the same thing.

Tag(items, expand?, weight?, quality?, modifier?, condition?)
items
ItemListRef

The item tag.

expandoptional
bool

If true, each of the items becomes an independent entry in the pool with the same weight and quality. If false, drops all items in the tag. Defaults to false.

weightoptional
int 1..

How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1.

qualityoptional
int

Changes weight by the luck of the player: the weight becomes weight + quality * luck. Defaults to 0.

modifieroptional
ItemModifier

Item modifiers (loot functions) applied to the items this entry gives.

conditionoptional
PredicateRef

Conditions that must all pass for the entry to be used. Combine several with && and ||.