Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-275648

Conditions don't work on the sequence function in loot tables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 24w33a, 1.21.1, 24w36a
    • None
    • Confirmed
    • Data Packs, Loot tables

      In loot tables, conditions on the `sequence` function don't have any effect

      What I expected to happen was...:
      The conditions should be applied

      What actually happened was...:
      The conditions don't have any effect

      Steps to Reproduce:
      1. Create a loot table in a datapack
      2. Apply the sequence function to an item. Example :

      {
        "pools": [
          {
            "rolls": 1,
            "entries": [
              {
                "type": "minecraft:item",
                "name": "minecraft:bow",
                "functions": [
                  {
                    "function": "minecraft:sequence",
                    "functions": [
                      {
                        "function": "minecraft:set_enchantments",
                        "enchantments": {
                          "minecraft:infinity": 1
                        }
                      },
                      {
                        "function": "minecraft:set_lore",
                        "lore": [
                          {
                            "text": "custom lore"
                          }
                        ],
                        "mode": "append"
                      }
                    ],
                    "conditions": [
                      {
                        "condition": "minecraft:random_chance",
                        "chance": 0
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }

      3. Load the datapack (example with one added as attachement)

      4. Run the command `/loot give @s loot test:sequence_condition` to give yourself the loot of the loot table

      The bow should not have any enchantment or custom lore, as the random chance is 0. But it does.

       

        1. bug_report.zip
          1 kB
        2. image-2024-08-19-21-49-07-339.png
          image-2024-08-19-21-49-07-339.png
          1.55 MB
        3. 2024-08-20_11.00.31.png
          2024-08-20_11.00.31.png
          1.77 MB
        4. 2024-08-20_11.00.23.png
          2024-08-20_11.00.23.png
          3.20 MB

            Unassigned Unassigned
            Bafy78 Bafy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: