//bridge-file-version: #305
{
	"format_version": "1.14.0",
	"minecraft:entity": {
		"description": {
			"identifier": "car:tosca_gb",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false
		},
		"components": {
			    "minecraft:horse_saddled": {
				"minecraft:is_saddled": {
				},
				"minecraft:input_ground_controlled": {
				},
				"minecraft:behavior.player_ride_tamed": {
				}
			  },
			"minecraft:breathable": {
				"totalSupply": 15,
				"suffocateTime": 0
			},
			"minecraft:collision_box": {
				"width": 1,
				"height": 1
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": true
			},
			"minecraft:inventory": {
				"inventory_size": 16,
				"container_type": "horse",
				"restrict_to_owner": true
			},
			"minecraft:tameable": {
			  "probability": 1,
			  "tame_items": "dye",
			  "tame_event": {
				"event": "minecraft:on_tame",
				"target": "self"
			  }
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:health": {
				"value": 50,
				"max": 50
			},
			"minecraft:scale": {
				"value": 1.2
			},
			"minecraft:nameable": {},
			"minecraft:equippable": {
			"slots": [
			  {
				"slot": 0,
				"item": "saddle",
				"accepted_items": ["saddle"],
				"on_equip": {
				  "event": "move_start"
				},
				"on_unequip": {
				  "event": "move_stop"
				}
			  }
			]
		  },
			"minecraft:rideable": {
				"priority": 0,
				"seat_count": 4,
				"rotate_rider_by": -90,
				"crouching_skip_interact": true,
				"family_types": [
            "player",
            "zombie"],
				"interact_text": "Ride",
				"seats": [		
					{
						"position": [
							0.58,
							0.5,
							0.3
						]
					},
					{
						"position": [
							-0.613,
							0.5,
							0.15
						]
					},
									{
						"position": [
							0.525,
							0.45,
							-1
						]
					},
					{
						"position": [
							-0.525,
							0.45,
							-1
						]
					}				
				],
				"rider_can_interact": true
			},
			"minecraft:type_family": {
				"family": [
					"car"
				]
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": true
			},
			"minecraft:physics": {},
			"minecraft:input_ground_controlled": {},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "fall",
						"deals_damage": false
					}
				]
			},
			"minecraft:movement": {
				"value": 0
			},
			"minecraft:variant": {
				"value": 0
			},
			"minecraft:loot": {
				"table": "loot_tables/tosca.json"
			}
		},
		"events": {
				"move_start": {
					"add": {
					"component_groups": [
					"minecraft:horse_saddled"
						]
					}
				},
				"move_stop": {
					"remove": {
					"component_groups": [
					"minecraft:horse_saddled"
						]
					}
				},
				      "minecraft:on_tame": {
        "remove": {
          "component_groups": [
            "minecraft:donkey_wild"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:donkey_tamed",
            "minecraft:donkey_unchested"
          ]
        }
      },
      "minecraft:on_chest": {
        "remove": {
          "component_groups": [
            "minecraft:donkey_unchested"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:donkey_chested"
          ]
        }
      }
		},
		"component_groups": {
			      "minecraft:donkey_unchested": {
        "minecraft:interact": {
          "interactions": [
            {
              "play_sounds": "armor.equip_generic",
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test" :  "is_family", "subject" : "other", "value" :  "player"},
                    { "test" :  "has_equipment", "domain": "hand","subject" : "other", "value" :  "chest"}
                  ]
                },
                "event": "minecraft:on_chest",
                "target": "self"
              },
              "use_item": true,
              "interact_text": "action.interact.attachchest"
            }
          ]
        }
      },

      "minecraft:donkey_chested": {
        "minecraft:is_chested": {

        }
      },

			"minecraft:horse_saddled": {
				"minecraft:is_saddled": {
				},
				"minecraft:behavior.controlled_by_player": {
				},
				"minecraft:input_ground_controlled": {
				},
				"minecraft:movement": {
					"value": 0.425
				},
				"minecraft:behavior.player_ride_tamed": {
				}
			}

		}
	}
}