{
	"format_version": "1.16.0",
	"minecraft:entity": {
		"description": {
			"identifier": "cc_fairytales:goblin",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"goblin": "controller.animation.cc_fairytales.goblin_effect"
			},
			"scripts": {
				"animate": [
					"goblin"
				]
			}
		},
		"component_groups": {
			"pacifico": {
				"minecraft:mark_variant": {
					"value": 1
				},
				"minecraft:behavior.melee_attack": {
					"priority": 4,
					"speed_multiplier": 1.25,
					"track_target": false,
					"attack_once": true,
					"on_attack": {
						"target": "self",
						"event": "iniciar_timer"
					}
				},
				"minecraft:attack": {
					"damage": 0
				},
				"minecraft:behavior.move_towards_target": {
					"within_radius": 2
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 1,
					"must_see": true,
					"must_see_forget_duration": 1.0,
					"reselect_targets": true,
					"scan_interval": 10,
					"entity_types": [
						{
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							"max_dist": 20
						}
					]
				}
			},
			"recibe_oro": {
				"minecraft:interact": {
					"interactions": {
						"use_item": true,
						"interact_text": "action.interact.goblin.friend",
						"on_interact": {
							"filters": {
								"all_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									},
									{
										"test": "has_equipment",
										"subject": "other",
										"domain": "hand",
										"value": "gold_ingot"
									}
								]
							},
							"event": "amigo"
						}
					}
				}
			},
			"contador_tiempo": {
				"minecraft:timer": {
					"time": 10,
					"looping": true,
					"time_down_event": {
						"event": "enojado",
						"target": "self"
					}
				}
			},
			"lentitud": {
				"minecraft:mark_variant": {
					"value": 2
				}
			},
			"ceguera": {
				"minecraft:mark_variant": {
					"value": 3
				}
			},
			"minera": {
				"minecraft:mark_variant": {
					"value": 4
				}
			},
			"prisa": {
				"minecraft:mark_variant": {
					"value": 5
				}
			},
			"nocturna": {
				"minecraft:mark_variant": {
					"value": 6
				}
			},
			"velocidad": {
				"minecraft:mark_variant": {
					"value": 7
				}
			},
			"sensor_golpeo": {
				"minecraft:damage_sensor": {
					"triggers": [
						{
							"on_damage": {
								"filters": {
									"test": "is_family",
									"subject": "other",
									"value": "player"
								},
								"event": "mas_enojado"
							},
							"deals_damage": false
						}
					]
				}
			},
			"efectos_duraderos": {
				"minecraft:mark_variant": {
					"value": 10
				}
			},
			"c_va": {
				"minecraft:behavior.avoid_mob_type": {
					"priority": 3,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							},
							"max_dist": 30,
							"sprint_speed_multiplier": 3.2
						}
					]
				},
				"minecraft:timer": {
					"time": 5,
					"looping": true,
					"time_down_event": {
						"event": "desaparecer",
						"target": "self"
					}
				}
			},
			"despawn": {
				"minecraft:instant_despawn": {
					"remove_child_entities": true
				}
			}
		},
		"components": {
			"minecraft:ambient_sound_interval": {
				"event_name": "ambient",
				"range": 4,
				"value": 2
			},
			"minecraft:mark_variant": {
				"value": 0
			},
			"minecraft:experience_reward": {
				"on_death": "query.last_hit_by_player ? 5 : 0"
			},
			"minecraft:type_family": {
				"family": [
					"goblin"
				]
			},
			"minecraft:nameable": {},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0
			},
			"minecraft:collision_box": {
				"width": 0.6,
				"height": 1.8
			},
			"minecraft:movement": {
				"value": 0.2
			},
			"minecraft:navigation.walk": {
				"can_path_over_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:health": {
				"value": 20,
				"max": 20
			},
			"minecraft:behavior.float": {
				"priority": 0
			},
			"minecraft:behavior.look_at_player": {
				"priority": 7,
				"look_distance": 6,
				"probability": 0.02
			},
			"minecraft:behavior.random_look_around": {
				"priority": 6
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:follow_range": {
				"value": 48,
				"max": 48
			},
			"minecraft:conditional_bandwidth_optimization": {}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"pacifico",
						"recibe_oro",
						"sensor_golpeo"
					]
				}
			},
			"iniciar_timer": {
				"add": {
					"component_groups": [
						"contador_tiempo"
					]
				}
			},
			"enojado": {
				"sequence": [
					{
						"remove": {
							"component_groups": [
								"pacifico"
							]
						}
					},
					{
						"randomize": [
							{
								"weight": 10,
								"add": {
									"component_groups": [
										"lentitud"
									]
								}
							},
							{
								"weight": 10,
								"add": {
									"component_groups": [
										"ceguera"
									]
								}
							},
							{
								"weight": 10,
								"add": {
									"component_groups": [
										"minera"
									]
								}
							}
						]
					},
					{
						"add": {
							"component_groups": [
								"c_va"
							]
						}
					}
				]
			},
			"mas_enojado": {
				"sequence": [
					{
						"remove": {
							"component_groups": [
								"pacifico",
								"recibe_oro",
								"contador_tiempo"
							]
						}
					},
					{
						"add": {
							"component_groups": [
								"efectos_duraderos",
								"c_va"
							]
						}
					}
				]
			},
			"amigo": {
				"sequence": [
					{
						"remove": {
							"component_groups": [
								"pacifico",
								"contador_tiempo"
							]
						}
					},
					{
						"randomize": [
							{
								"weight": 10,
								"add": {
									"component_groups": [
										"prisa"
									]
								}
							},
							{
								"weight": 20,
								"add": {
									"component_groups": [
										"nocturna"
									]
								}
							},
							{
								"weight": 20,
								"add": {
									"component_groups": [
										"velocidad"
									]
								}
							}
						]
					},
					{
						"add": {
							"component_groups": [
								"c_va"
							]
						}
					}
				]
			},
			"desaparecer": {
				"add": {
					"component_groups": [
						"despawn"
					]
				}
			}
		}
	}
}