{
  "format_version": "1.18.0",
  "minecraft:entity": {
    "description": {
      "identifier": "pixel:thrust_damage",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false,
	  "scripts": {
		"animate": [
	      "long"
		]
      },
	  "animations": {
		"run": "controller.animation.thrustCharge",
		"long":"animation.attack.remover_1s"
	  }
    },
    "component_groups": {
      "despawn":{
	    "minecraft:instant_despawn":{}
      },
      "shoot":{
	    "minecraft:variant":{
	      "value": 2
	    }
      },
      "lance_horse":{
        "minecraft:behavior.knockback_roar": {
          "priority": 1,
          "duration": 0.1,
          "attack_time": 0.1,
          "knockback_damage": 10,
          "knockback_strength": 7,
          "knockback_range": 1,
          "knockback_filters": {
            "test": "has_tag",
            "subject": "other",
            "operator": "!=",
            "value": "thrst"
          },
          "damage_filters": {
            "test": "has_tag",
            "subject": "other",
            "operator": "!=",
            "value": "thrst"
          },
          "on_roar_end": {
            "event": "remove_damage"
          },
          "cooldown_time": 0.01
        },
	    "minecraft:timer":{
	      "time": 10,
	      "looping": true,
	      "time_down_event":{
	      "event": "remove_damage",
	        "target": "self"
	      }
	    }
      },
      "lance_null":{
	    "minecraft:timer":{
	      "time": 0.05,
	      "looping": true,
	      "time_down_event":{
	      "event": "remove_tag",
	        "target": "self"
	      }
	    }
      },
      "nonshoot":{
	    "minecraft:variant":{
	      "value": 1
	    }
      }
    },

    "components": {
      "minecraft:collision_box": {
        "width": 0.0,
        "height": 0.0
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "any",
          "deals_damage": false
        }
      },
      "minecraft:type_family": {
        "family": [ "attack", "lancer" ]
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "add":{
          "component_groups":[
            "lance_horse"
          ]
        }
      },
      "non_shoot": {
        "add":{
          "component_groups":[
            "nonshoot"
          ]
        }
      },
      "lance_horse": {
        "add":{
          "component_groups":[
            "lance_horse"
          ]
        }
      },
      "remove_damage":{
        "remove":{
          "component_groups":[
            "lance_horse"
          ]
        }
      },
      "remove_tag":{
        "run_command": {
          "command": [
            "execute as @a[tag=thrst,c=1] run tag @s remove thrst",
            "execute as @e[family=!player,tag=thrst,c=1] run tag @s remove thrst"
          ]
        }
      },
      "remove_katana":{
        "add":{
          "component_groups":[
               "despawn"
          ]
        }
      }
    }
  }
}




