#Loot Table extensive Modifying.

2 messages · Page 1 of 1 (latest)

frank frost
#

Loot table question:
In all available loottables, I want to detect pools which both contain the presence:

  • of the table_bonus condition
  • of an item entry which is of a predifined, arbitrary item tag

In these pools, I need to wrap the existing table_bonus condition in a any_of condition, and add my own loot condition inside that any_of, which also needs access to the chances field defined on the table_bonus

I don't need exact code but some suggestions about how one can go about this would help a lot 🙂

{
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:apple",
          "conditions": [
            {
              "condition": "minecraft:table_bonus",
              "enchantment": "minecraft:fortune",
              "chances": [
                0.005,
                0.0055555557,
                0.00625
              ]
            }
          ]
        }
      ],
}

should become


      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:apple",
                  "conditions": [
                    {
                      "condition": "minecraft:any_of",
                      "terms": [
                        {
                          "chances": [                            
                              0.005,
                              0.0055555557,
                              0.00625
                          ],
                          "condition": "minecraft:table_bonus",
                          "enchantment": "minecraft:fortune"
                        },
                        {
                          "attribute": "mod.my_attribute",
                          "base_chance": 0.005, //Notice how I accessed the chances field of the table_bonus
                          "condition": "mod:my_condition"
                        }
                      ]
                    }
marble fiber
#

Sounds like you may need to use loot table events