{
	"format_version": "1.20.50",
	"minecraft:entity": {
		"description": {
			"identifier": "eddieworks:plush_manada",
			"is_summonable": true,
			"animations": { "controller": "controller.animation.plush_behavior" },
			"scripts": 	  { "animate": [ "controller" ] },
			"properties": {
				"plush:spawn": 		{ "type": "bool", "default": true, "client_sync": true },
				"plush:hit": 		{ "type": "bool", "default": false, "client_sync": true },
				"plush:interact": 	{ "type": "bool", "default": false, "client_sync": true },
				"plush:remove": 	{ "type": "bool", "default": false, "client_sync": true }
			}
		},
		"component_groups": {
			"eddie": 		{ "minecraft:mark_variant": { "value": 0 } },
			"giocat": 		{ "minecraft:mark_variant": { "value": 1 } },
			"moon": 		{ "minecraft:mark_variant": { "value": 2 } },
			"kotho": 		{ "minecraft:mark_variant": { "value": 3 } },
			"kody": 		{ "minecraft:mark_variant": { "value": 4 } },
			"richie": 		{ "minecraft:mark_variant": { "value": 5 } },
			"honey": 		{ "minecraft:mark_variant": { "value": 6 } },
			"diana": 		{ "minecraft:mark_variant": { "value": 7 } },
			"seku": 		{ "minecraft:mark_variant": { "value": 8 } },

			"remove_timer": {
				"minecraft:timer": {
					"time": 0.44,
					"looping": false,
					"time_down_event": { "event": "plush:despawn" }
				}
			},
			"remove_timer_instabuild": {
				"minecraft:timer": {
					"time": 0.44,
					"looping": false,
					"time_down_event": { "event": "plush:despawn_instabuild" }
				}
			},
			"instant_despawn": {
				"minecraft:behavior.sneeze": {
					"loot_table": "loot_tables/manada.loot.json",
					"prepare_time": 0,
					"probability": 1
				},
				"minecraft:instant_despawn": {}
			},
			"despawn_instabuild": { "minecraft:instant_despawn": {} }
		},
		"components": {
			"minecraft:timer": {
				"time": 0.74,
				"looping": false,
				"time_down_event": { "event": "plush:spawn_time_out" }
			},
			"minecraft:custom_hit_test": {
				"hitboxes": [
					{
						"width": 0.4,
						"height": 0.8,
						"pivot": [0, 0.4, 0]
					}
				]
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "entity_attack",
						"on_damage": {
							"filters": [
								{
									"all_of": [
										{ "test": "is_sneaking", "subject": "player", "value": false },
										{ "test": "bool_property", "domain": "plush:hit", "value": false }
									]
								}
							],
							"event": "plush:on_hit"
						},
						"on_damage_sound_event": "hit",
						"deals_damage": false
					},
					{
						"cause": "entity_attack",
						"on_damage": {
							"filters": { "test": "is_sneaking", "subject": "player", "value": true },
							"event": "plush:remove"
						},
						"on_damage_sound_event": "death",
						"deals_damage": false
					},
					{ "cause": "all", "deals_damage": false }
				]
			},
			"minecraft:interact": {
				"interactions": [
					{
						"on_interact": {
							"filters": { "test": "bool_property", "domain": "plush:interact", "value": false },
							"event": "plush:on_interact"
						},
						"play_sounds": "roar"
					}
				]
			},
			"minecraft:fire_immune": {},
			"minecraft:health": {
				"value": 1,
				"max": 1
			},
			"minecraft:collision_box": {
				"height": 0.4,
				"width": 0.8
			},
			"minecraft:physics": {
				"has_collision": true,
				"has_gravity": true
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": true
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"sequence": [
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_eddie_spawn" },
						"add": { "component_groups": [ "eddie" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_giocat_spawn" },
						"add": { "component_groups": [ "giocat" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_moon_spawn" },
						"add": { "component_groups": [ "moon" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_kotho_spawn" },
						"add": { "component_groups": [ "kotho" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_kody_spawn" },
						"add": { "component_groups": [ "kody" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_richie_spawn" },
						"add": { "component_groups": [ "richie" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_honey_spawn" },
						"add": { "component_groups": [ "honey" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_diana_spawn" },
						"add": { "component_groups": [ "diana" ] }
					},
					{
						"filters": { "test": "has_equipment", "subject": "other", "value": "eddieworks:plush_seku_spawn" },
						"add": { "component_groups": [ "seku" ] }
					}
				]
			},
			"plush:spawn_time_out": { "set_property": { "plush:spawn": false } },
			"plush:on_hit": 		{ "set_property": { "plush:hit": true } },
			"plush:on_interact": 	{ "set_property": { "plush:interact": true } },
			"plush:out_hit": 		{ "set_property": { "plush:hit": false } },
			"plush:out_interact": 	{ "set_property": { "plush:interact": false } },
			"plush:remove": 		{
				"sequence": [
					{ "set_property": { "plush:remove": true } },
					{
						"filters": { "test": "has_ability", "subject": "player", "operator": "!=", "value": "instabuild" },
						"add": { "component_groups": [ "remove_timer" ] }
					},
					{
						"filters": { "test": "has_ability", "subject": "player", "operator": "==", "value": "instabuild" },
						"add": { "component_groups": [ "remove_timer_instabuild" ] }
					}
				]
			},
			"plush:despawn": 		{ "add": { "component_groups": [ "instant_despawn" ] } },
			"plush:despawn_instabuild": { "add": { "component_groups": [ "despawn_instabuild" ] } }
		}
	}
}