{
  "type": "minecraft:chest",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:emerald",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 5,
                "max": 12
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_desert\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 5,
                "max": 12
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_witch\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 13,
                "max": 24
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_swamp\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 13,
                "max": 24
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_traveler\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 13,
                "max": 24
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_port\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 25,
                "max": 36
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_jungle\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 25,
                "max": 36
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_pale\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 37,
                "max": 48
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_snowy\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 37,
                "max": 48
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_keep\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 49,
                "max": 64
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_illager\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 49,
                "max": 64
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_donjon\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 49,
                "max": 64
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_end\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "type": "minecraft:uniform",
                "min": 37,
                "max": 48
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "nbt": "{Tags:[\"dnt_librarian_sculk\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 49,
                "max": 64
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_librarian_sealing\"]}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 8,
                "max": 12
              },
              "conditions": [
                {
                  "condition": "minecraft:any_of",
                  "terms": [
                    {
                      "condition": "minecraft:entity_properties",
                      "entity": "this",
                      "predicate": {
                        "type": "minecraft:villager",
                        "nbt": "{Tags:[\"dnt_quest_trader\"],VillagerData:{level:1}}"
                      }
                    },
                    {
                      "condition": "minecraft:entity_properties",
                      "entity": "this",
                      "predicate": {
                        "type": "minecraft:villager",
                        "nbt": "{Tags:[\"dnt_quest_trader\"],VillagerData:{level:2}}"
                      }
                    }
                  ]
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 16,
                "max": 24
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_quest_trader\"],VillagerData:{level:3}}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 32,
                "max": 40
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_quest_trader\"],VillagerData:{level:4}}"
                  }
                }
              ]
            },
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 48,
                "max": 56
              },
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "type": "minecraft:villager",
                    "nbt": "{Tags:[\"dnt_quest_trader\"],VillagerData:{level:5}}"
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}