{
  "format_version": "1.17.40",
  "minecraft:entity": {
    "description": {
      "identifier": "oct_spcrs:car_12",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false,
      "properties": {
        "oct_spcrs:is_punched": {
          "client_sync": true,
          "type": "bool",
          "default": false
        },
        "oct_spcrs:car_color_id": {
          "client_sync": true,
          "type": "int",
          "default": 6, // silver
          "range": [
            0,
            8
          ]
        },
        "oct_spcrs:anim.break": {
          "client_sync": true,
          "type": "bool",
          "default": true // don't question this
        },
        "oct_spcrs:anim.reverse": {
          "client_sync": true,
          "type": "bool",
          "default": false
        },
        "oct_spcrs:anim.bounce": {
          "client_sync": true,
          "type": "bool",
          "default": false
        },
        "oct_spcrs:anim.drift": {
          "client_sync": true,
          "type": "bool",
          "default": false
        },
        "oct_spcrs:anim.spawn_anim": {
          "client_sync": true,
          "type": "bool",
          "default": true
        },
        "oct_spcrs:anim.speed_lines": {
          "client_sync": true,
          "type": "bool",
          "default": false
        },
        "oct_spcrs:anim.nitro": {
          "client_sync": true,
          "type": "bool",
          "default": false
        }
      },
      "animations": {
        "controller.rider_check": "controller.animation.oct_spcrs.car.rider_check"
      },
      "scripts": {
        "animate": [
          "controller.rider_check"
        ]
      }
    },
    "components": {
      //Stats
      "minecraft:type_family": {
        "family": [
          "oct_spcrs_car_12",
          "oct_spcrs",
          "breakable_by_punching"
        ]
      },
      "minecraft:collision_box": {
        "width": 3.5,
        "height": 2.5
      },
      "minecraft:scale": {
        "value": 0.7
      },
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:movement": {
        "value": 0.001,
        "max": 0.85,
        "min": 0.0
      },
      "minecraft:rideable": {
        "controlling_seat": 0,
        "crouching_skip_interact": true,
        "family_types": [
          "player"
        ],
        "pull_in_entities": false,
        "rider_can_interact": true,
        "interact_text": "action.interact.oct_spcrs.ride_car",
        "seat_count": 2,
        "seats": [
          { //driver
            "min_rider_count": 0,
            "position": [
              0.7,
              0.3,
              -0.1
            ]
          },
          { //front right
            "min_rider_count": 1,
            "lock_rider_rotation": 181,
            "position": [
              -0.7,
              0.3,
              -0.1
            ]
          }
        ]
      },
      "minecraft:healable": {
        "force_use": false,
        "items": [
          {
            "item": "oct_spcrs:repair_kit",
            "heal_amount": 10
          }
        ]
      },
      "minecraft:inventory": {
        "container_type": "hopper",
        "inventory_size": 5,
        "private": false,
        "restrict_to_owner": false
      },
      "minecraft:nameable": {
        "allow_name_tag_renaming": true,
        "always_show": false
      },
      "minecraft:knockback_resistance": {
        "value": 1,
        "max": 1
      },
      "minecraft:damage_sensor": {
        "triggers": [
          { //cancel other player damage
            "cause": "all",
            "on_damage": {
              "filters": [
                {
                  "all_of": [
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "player"
                    }
                  ]
                }
              ]
            },
            "deals_damage": false
          },
          { //reduce fall damage
            "cause": "fall",
            "on_damage": {
              "target": "self",
              "event": "oct_spcrs:bounce"
            },
            "deals_damage": true,
            "damage_multiplier": 0.6666
          }
        ]
      },
      "minecraft:can_power_jump": {},
      "minecraft:horse.jump_strength": {
        "value": 0.0
      },
      "minecraft:navigation.walk": {},
      "minecraft:movement.basic": {},
      "minecraft:input_ground_controlled": {},
      "minecraft:physics": {
        "has_gravity": true,
        "has_collision": true
      },
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": false
      },
      "minecraft:conditional_bandwidth_optimization": {}
    },
    "component_groups": {
      "oct_spcrs:despawn": {
        "minecraft:instant_despawn": {}
      },
      "oct_spcrs:is_punched.reset_timer": {
        "minecraft:behavior.timer_flag_1": {
          "priority": 0,
          "cooldown_range": [
            0.1,
            0.1
          ],
          "duration_range": [
            0.1,
            0.1
          ],
          "on_end": {
            "target": "self",
            "event": "oct_spcrs:is_punched.reset"
          }
        }
      },
      "oct_spcrs:bounce.reset_timer": {
        "minecraft:behavior.timer_flag_2": {
          "priority": 0,
          "cooldown_range": [
            0.1,
            0.1
          ],
          "duration_range": [
            0.1,
            0.1
          ],
          "on_end": {
            "target": "self",
            "event": "oct_spcrs:bounce.reset"
          }
        }
      }
    },
    "events": {
      "oct_spcrs:despawn": {
        "add": {
          "component_groups": [
            "oct_spcrs:despawn"
          ]
        }
      },
      "oct_spcrs:is_punched": {
        "add": {
          "component_groups": [
            "oct_spcrs:is_punched.reset_timer"
          ]
        },
        "set_property": {
          "oct_spcrs:is_punched": true
        }
      },
      "oct_spcrs:is_punched.reset": {
        "remove": {
          "component_groups": [
            "oct_spcrs:is_punched.reset_timer"
          ]
        },
        "set_property": {
          "oct_spcrs:is_punched": false
        }
      },
      "oct_spcrs:bounce": {
        "add": {
          "component_groups": [
            "oct_spcrs:bounce.reset_timer"
          ]
        },
        "set_property": {
          "oct_spcrs:anim.bounce": true
        }
      },
      "oct_spcrs:bounce.reset": {
        "remove": {
          "component_groups": [
            "oct_spcrs:bounce.reset_timer"
          ]
        },
        "set_property": {
          "oct_spcrs:anim.bounce": false
        }
      }
    }
  }
}