mojira.dev
MC-313446

Loot table groups with one child stop sequences when their child fails, unlike larger groups

The Bug:

Loot table groups with one child stop sequences when their child fails, unlike larger groups.

Groups of loot entries normally count as successful, so the next entry in a sequence still runs. However, a group with only one child counts as failed when that child's condition fails, so the rest of the sequence is skipped, therefore introducing an inconsistency.

Steps to Reproduce:

  1. Give yourself the loot of a loot table whose group has one child by using the command provided below.

    /loot give @s loot {pools:[{rolls:1,entries:[{type:"sequence",children:[{type:"group",children:[{type:"empty",condition:{type:"random_chance",chance:0}}]},{type:"item",name:"diamond"}]}]}]}
  2. Give yourself the loot of the same loot table with a second child in its group by using the command provided below.

    /loot give @s loot {pools:[{rolls:1,entries:[{type:"sequence",children:[{type:"group",children:[{type:"empty",condition:{type:"random_chance",chance:0}},{type:"empty",condition:{type:"random_chance",chance:0}}]},{type:"item",name:"diamond"}]}]}]}
  3. Observe how only the second command gives you a diamond.

Observed Behavior:

Loot table groups with one child stop sequences when their child fails.

Expected Behavior:

Loot table groups with one child would not stop sequences, just like larger groups.

Attachments

Comments 1

Avoma

(Unassigned)

Confirmed

Data Packs, Loot tables

26.3, 26.4 Snapshot 10

Retrieved