//This JSON was modified by LateLag (@LateLagMC). Please do not use this document without permission.
{
  "format_version": "1.10.0",
  "minecraft:attachable": {
    "description": {
      "identifier": "minecraft:spyglass",
      "materials": {
        "default": "entity_alphatest",
        "enchanted": "entity_alphatest_glint"
      },
      "textures": {
        "default": "textures/entity/spyglass",
        "enchanted": "textures/misc/enchanted_item_glint"
      },
      "geometry": {
        "default": "geometry.spyglass"
      },
      "animations": {
        "holding": "animation.spyglass.holding",
        "holding_offhand": "animation.spyglass.holding_offhand",
        "scoping": "animation.spyglass.scoping"
      },
      "scripts": {
        "pre_animation": [
          "variable.is_in_offhand = c.item_slot == 'off_hand';",
          "variable.is_first_person = c.is_first_person;"
        ],
        "animate": [
          {
            "holding": "q.main_hand_item_use_duration <= 0.0f && c.item_slot == 'main_hand'"
          },
          {
            "holding_offhand": "variable.is_in_offhand"
          },
          {
            "scoping": "q.main_hand_item_use_duration > 0.0f && !c.is_first_person && !variable.is_in_offhand"
          }
        ]
      },
      "render_controllers": [ "controller.render.spyglass" ]
    }
  }
}
