{
  "format_version": "1.16.100",
  "minecraft:item": {
    "description": {

      "identifier": "vatonage:magic_book"
    },
    "components": {
      "minecraft:max_stack_size": 64,
      "minecraft:foil": false,
      "minecraft:stacked_by_data": true,
      "minecraft:icon":{
         "texture":"magic_book"
      },
      "minecraft:display_name":{
         "value":"Magic Book"
      },
      "minecraft:can_destroy_in_creative": false,
         "minecraft:on_use":{
            "on_use":{
               "event":"used"
            }
         }
      },
      "events":{
         "used":{
            "sequence":[
               {
                  "condition":"query.is_sneaking == false",
                  "swing":{
                  },
                  "run_command":{
                     "command":[
                        "function checklevel"
                     ]
                  }
               },
               {
                  "condition":"query.is_sneaking == true",
                  "swing":{
                  },
                  "run_command":{
                     "command":[
                        "structure load magictutorial ~ ~ ~",
                        "clear @s vatonage:magic_book 0 1"
                     ]
                  }
               }
            ]
         }
      }
   }
}