{
  "wants": {
    "id": "minecraft:emerald",
    "count": 0
  },
  "additional_wants": {
    "id": "minecraft:book",
    "count": 1
  },
  "gives": {
    "id": "minecraft:enchanted_book"
  },
  "given_item_modifiers": [
    {
      "function": "minecraft:enchant_randomly",
      "options": "#mot_structures:nightfall",
      "only_compatible": false,
      "include_additional_cost_component": true
    },
    {
      "function": "minecraft:filtered",
      "item_filter": {
        "predicates": {
          "minecraft:stored_enchantments": [
            {
              "enchantments": "mot_structures:nightfall"
            }
          ]
        }
      },
      "on_fail": {
        "function": "minecraft:discard"
      }
    }
  ],
  "max_uses": 12,
  "reputation_discount": 0.2,
  "merchant_predicate": {
    "condition": "minecraft:location_check",
    "predicate": {
      "structures": "#mot_structures:offers_trades_pale"
    }
  }
}