{
  "criteria": {
    "player_write_book": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": "written_book"
          }
        ],
        "player": {
          "slots": {
            "weapon.*": {
              "items": "written_book"
            }
          }
        }
      }
    }
  },
  "requirements": [
    [
      "player_write_book"
    ]
  ],
  "rewards": {
    "function": "overly_realistic:players/items/written_book/player_write_written_book"
  }
}