{
	"format_version": "1.20.80",
	"minecraft:entity": {
		"description": {
			"identifier": "v360:rascal",
			"is_summonable": true,
			"is_spawnable": true
		},
		"component_groups": {
			"hide1": {
				"minecraft:entity_sensor": {
					"subsensors": [
						{
							"event": "hide1",
							"cooldown": -0.1,
							"range": [
								2,
								1
							],
							"minimum_count": 1,
							"maximum_count": 1,
							"event_filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					]
				}
			},
			"hide2": {
				"minecraft:entity_sensor": {
					"subsensors": [
						{
							"event": "hide2",
							"cooldown": -0.1,
							"range": [
								2,
								1
							],
							"minimum_count": 1,
							"maximum_count": 1,
							"event_filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					]
				}
			},
			"run_away1": {
				"minecraft:timer": {
					"time": 20,
					"looping": false,
					"time_down_event": {
						"event": "stop_hiding1"
					}
				}
			},
			"run_away2": {
				"minecraft:timer": {
					"time": 20,
					"looping": false,
					"time_down_event": {
						"event": "stop_hiding2"
					}
				}
			},
			"hide3": {
				"minecraft:entity_sensor": {
					"subsensors": [
						{
							"event": "give_player_reward",
							"cooldown": -0.1,
							"range": [
								2,
								1
							],
							"minimum_count": 1,
							"maximum_count": 1,
							"event_filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					]
				}
			},
			"give_player_reward": {
				"minecraft:behavior.timer_flag_1": {
					"priority": 0,
					"cooldown_range": [
						0,
						0
					],
					"duration_range": [
						2.75,
						2.75
					],
					"on_end": {
						"event": "spawn_loot"
					}
				}
			},
			"despawn": {
				"minecraft:behavior.dig": {
					"priority": 0,
					"allow_dig_when_named": true,
					"digs_in_daylight": false,
					"duration": 1.4
				}
			},
			"hide": {
				"minecraft:behavior.avoid_mob_type": {
					"priority": 0,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							},
							"max_dist": 20,
							"sprint_speed_multiplier": 2,
							"walk_speed_multiplier": 2
						}
					]
				}
			}
		},
		"components": {
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:nameable": {},
			"minecraft:type_family": {
				"family": [
					"rascal",
					"mob"
				]
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 0.6
			},
			"minecraft:health": {
				"value": 20,
				"max": 20
			},
			"minecraft:hurt_on_condition": {
				"damage_conditions": [
					{
						"filters": {
							"test": "in_lava",
							"subject": "self",
							"operator": "==",
							"value": true
						},
						"cause": "lava",
						"damage_per_tick": 4
					}
				]
			},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0,
				"breathes_air": true,
				"breathes_water": true
			},
			"minecraft:experience_reward": {
				"on_death": "query.last_hit_by_player?5+(query.equipment_count*math.random(1,3)):0"
			},
			"minecraft:behavior.random_stroll": {
				"priority": 7,
				"speed_multiplier": 1
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 6,
				"probability": 0.02
			},
			"minecraft:behavior.random_look_around": {
				"priority": 9
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 1
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:despawn": {
				"despawn_from_distance": {}
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": false,
				"avoid_damage_blocks": true,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:can_climb": {},
			"minecraft:behavior.mount_pathing": {
				"priority": 2,
				"speed_multiplier": 1.25,
				"target_dist": 0,
				"track_target": true
			},
			"minecraft:jump.static": {}
		},
		"events": {
			"hide1": {
				"remove": {
					"component_groups": [
						"hide1"
					]
				},
				"add": {
					"component_groups": [
						"run_away1",
						"hide"
					]
				},
				"queue_command": {
					"target": "self",
					"command": [
						"effect @s invisibility 20 1 true",
						"playsound mob.rascal.hide @a[r=10] ~~~ 1 1"
					]
				}
			},
			"stop_hiding1": {
				"remove": {
					"component_groups": [
						"run_away1",
						"hide"
					]
				},
				"add": {
					"component_groups": [
						"hide2"
					]
				}
			},
			"hide2": {
				"remove": {
					"component_groups": [
						"hide2"
					]
				},
				"add": {
					"component_groups": [
						"run_away2",
						"hide"
					]
				},
				"queue_command": {
					"target": "self",
					"command": [
						"effect @s invisibility 20 1 true",
						"playsound mob.rascal.hide @a[r=10] ~~~ 1 1"
					]
				}
			},
			"stop_hiding2": {
				"remove": {
					"component_groups": [
						"run_away2",
						"hide"
					]
				},
				"add": {
					"component_groups": [
						"hide3"
					]
				}
			},
			"give_player_reward": {
				"add": {
					"component_groups": [
						"give_player_reward"
					]
				},
				"remove": {
					"component_groups": [
						"hide3"
					]
				},
				"queue_command": {
					"command": "playsound mob.rascal.give_item @a[r=10] ~~~ 1 1"
				}
			},
			"spawn_loot": {
				"queue_command": {
					"command": "loot spawn ~~~ loot rascal",
					"target": "self"
				},
				"add": {
					"component_groups": [
						"despawn"
					]
				}
			},
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"hide1"
					]
				}
			}
		}
	}
}