{
  "format_version": "1.20.80",
  "minecraft:entity": {
    "description": {
      "identifier": "lua_ma:guide_book",
      "is_spawnable": false,
      "is_summonable": true,
      "properties": {
        "lua_ma:pages": {
          "type": "int",
          "default": 0,
          "client_sync": true,
          "range": [
            0,
            9
          ]
        }
      }
    },
    "component_groups": {
      "drop": {
        "minecraft:spawn_entity": {
          "entities": {
            "min_wait_time": 0,
            "max_wait_time": 0,
            "num_to_spawn": 1,
            "single_use": true,
            "spawn_sound": "plop",
            "spawn_item": "lua_ma:guide_book",
            "spawn_item_event": {
              "event": "despawn",
              "target": "self"
            }
          }
        },
        "minecraft:timer": {
          "time": [
            0.0,
            0.0
          ],
          "looping": false,
          "time_down_event": {
            "event": "despawn",
            "target": "self"
          }
        }
      },
      "despawn": {
        "minecraft:instant_despawn": {
          "remove_child_entities": false
        }
      }
    },
    "components": {
      "minecraft:health": {
        "value": 10
      },
      "minecraft:scale": {
        "value": 1.5
      },
      "minecraft:physics": {},
      "minecraft:collision_box": {
        "height": 0.5,
        "width": 0.5
      },
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": [
                {
                  "all_of": [
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "player"
                    },
                    {
                      "test": "is_sneaking",
                      "subject": "other",
                      "value": false
                    }
                  ]
                }
              ],
              "target": "self",
              "event": "next_page"
            }
          },
          {
            "on_interact": {
              "filters": [
                {
                  "all_of": [
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "player"
                    },
                    {
                      "test": "is_sneaking",
                      "subject": "other",
                      "value": true
                    }
                  ]
                }
              ],
              "target": "self",
              "event": "prev_page"
            }
          }
        ]
      },
      "minecraft:persistent": {},
      "minecraft:fire_immune": {},
      "minecraft:knockback_resistance": {
        "value": 1,
        "max": 1
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "all",
            "deals_damage": false,
            "on_damage": {
              "target": "self",
              "event": "drop"
            }
          }
        ]
      }
    },
    "events": {
      "next_page": {
        "set_property": {
          "lua_ma:pages": "q.property('lua_ma:pages') + 1"
        }
      },
      "prev_page": {
        "set_property": {
          "lua_ma:pages": "q.property('lua_ma:pages') - 1"
        }
      },
      "drop": {
        "add": {
          "component_groups": [
            "drop"
          ]
        }
      },
      "despawn": {
        "add": {
          "component_groups": [
            "despawn"
          ]
        }
      }
    }
  }
}