{
	code: "deer",
	class: "EntityAgent",
	tags: ["animal", "huntable", "habitat-land"],
	weight: 4,
	variantgroups: [
		{ code: "type", "states": ["whitetail", "redbrocket", "marsh", "caribou", "water", "pudu", "elk", "taruca", "chital", "guemal", "pampas", "fallow" ] },
		{ code: "age", "states": ["baby"] },
		{ code: "gender", "states": ["male", "female"] }
	],
	hitBoxSizeByType: {
		"deer-redbrocket-*": { "x": 0.6,"y": 0.6},
		"deer-caribou-*": { "x": 0.9,"y": 0.9},
		"deer-pudu-*": { "x": 0.5,"y": 0.4},
		"deer-taruca-*": { "x": 0.6,"y": 0.6},
		"deer-pampas-*": { "x": 0.5,"y": 0.5},
		"*": { "x": 0.7,"y": 0.7}
	},
	deadhitBoxSizeByType: {
		"deer-redbrocket-*": { "x": 0.5,"y": 0.2},
		"deer-caribou-*": { "x": 0.9,"y": 0.4},
		"deer-water-*": { "x": 0.5,"y": 0.2},
		"deer-pudu-*": { "x": 0.5,"y": 0.2},
		"deer-taruca-*": { "x": 0.5,"y": 0.2},
		"deer-guemal-*": { "x": 0.5,"y": 0.2},
		"deer-pampas-*": { "x": 0.5,"y": 0.2},
		"*": { "x": 0.6,"y": 0.3}
	},
	eyeHeight: 0.6,
	fallDamageMultiplier: 0.5,
	drops: [],
	attributes: {
		killedByInfoText: "deadcreature-killed",
		creatureDiet: {
			foodCategories: ["Vegetable", "Grain"],
			weightedFoodTags: [
				{ weight: 0.1, code: "grass" },
				{ weight: 0.5, code: "nibbleCrop" }, 
				{ weight: 0.7, code: "grain" }, 
				{ weight: 0.9, code: "fruitmash" },
				{ weight: 1, code: "tastyvegetable" },
				{ weight: 0.2, code: "peanut" }
			],
			skipFoodTags: ["rice", "parsnip"]
		},
		trappableByType: {
			"deer-pudu-*": {
				"small": { trapChance: 0.2,	trapDestroyChance: 0.2 }
			},
			"*": {
				"small": { trapChance: 0.0,	trapDestroyChance: 0.2 },
				"large": { trapChance: 0.4,	trapDestroyChance: 0 }
			}
		},
		handbook: {
			groupcode: "creaturegroup-deer",
			trappableGroupCode: "creaturegroup-deer-{type}-{age}"
		}
	},
	behaviorConfigs: {
		controlledphysics: { 
			stepHeightByType: {
				"deer-pampas-*": 2.1251,
				"deer-pudu-*": 2.1251,
				"deer-redbrocket-*": 2.1251,
				"*": 3.1251
			}
		},
		floatupwhenstuck: { "onlyWhenDead": true },
		despawn: { "minPlayerDistance": 16, "belowLightLevel": 8, "minSeconds": 300 }
	},
	client: {
		renderer: "Shape",
		shapeByType: {
			"deer-redbrocket-*": { "base": "entity/animal/mammal/hooved/deer/taruca/baby" },
			"deer-marsh-*": { "base": "entity/animal/mammal/hooved/deer/whitetail/baby" },
			"deer-water-*": { "base": "entity/animal/mammal/hooved/deer/taruca/baby" },
			"deer-chital-*": { "base": "entity/animal/mammal/hooved/deer/whitetail/baby" },
			"deer-guemal-*": { "base": "entity/animal/mammal/hooved/deer/taruca/baby" },
			"deer-pampas-*": { "base": "entity/animal/mammal/hooved/deer/taruca/baby" },
			"deer-fallow-*": { "base": "entity/animal/mammal/hooved/deer/whitetail/baby" },
			"*": { "base": "entity/animal/mammal/hooved/deer/{type}/baby" }
		},
		textureByType: {
			"deer-marsh-*": { "base": "entity/animal/mammal/hooved/deer/whitetail-baby" },
			"deer-fallow-*": { "base": "entity/animal/mammal/hooved/deer/whitetail-baby" },
			"deer-chital-*": { "base": "entity/animal/mammal/hooved/deer/whitetail-baby" },
			"*": { "base": "entity/animal/mammal/hooved/deer/{type}-{age}" },    
		},
		behaviors: [
			{ code: "repulseagents" },
			{ code: "controlledphysics" },
			{ code: "interpolateposition" },
			{ code: "floatupwhenstuck" },
			{ code: "harvestable" },
			{ code: "despawn" },
			{ code: "ropetieable", minGeneration: 2 }
		],
		animations: [
			{
				code: "attack",
				animation: "Attack",
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "charge",
				animation: "Charge",
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "roar",
				animation: "Roar",
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "hurt",
				animation: "Hurt",
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "die",
				animation: "Die",
				easeInSpeed: 3,
				animationSpeed: 1.0,
				weight: 10,
				blendMode: "Average",
				triggeredBy: { "onControls": [ "dead" ] }
			},
			{
				code: "idle",
				animation: "Idle",
				blendMode: "AddAverage",
				easeOutSpeed: 4,
				triggeredBy: { "defaultAnim": true }
			},
			{
				code: "sleep",
				animation: "Sleep",
				easeInSpeed: 4,
				easeOutSpeed: 4,
				blendMode: "Average"
			},
			{
				code: "sit",
				animation: "Sit",
				easeInSpeed: 4,
				easeOutSpeed: 4,
				blendMode: "Average"
			},
			{
				code: "eat",
				animation: "Eat",
				easeInSpeed: 4,
				easeOutSpeed: 4,
				blendMode: "Average"
			},
			{
				code: "swim",
				animation: "Swim",
				supressDefaultAnimation: true,
				blendMode: "Average"
			},
			{
				code: "walk",
				animation: "Walk",
				supressDefaultAnimation: true,
				blendMode: "Average"
			},
			{
				code: "run",
				animation: "Run",
				supressDefaultAnimation: true,
				blendMode: "Average"
			},
			{
				code: "stot",
				animation: "Stot",
				supressDefaultAnimation: true,
				blendMode: "Average"
			},
			{
				code: "gallop",
				animation: "Gallop",
				supressDefaultAnimation: true,
				blendMode: "Average"
			}
		]
	},
	server: {
		attributes: {
			pathfinder: {
				minTurnAnglePerSec: 90,
				maxTurnAnglePerSec: 180
			}
		},
		behaviors: [
			{ code: "ropetieable", minGeneration: 2 },
			{ code: "repulseagents" },
			{ code: "controlledphysics" },
			{ code: "despawn" },
			{
				code: "health",
				currenthealthByType: {
					"deer-redbrocket-*": 3,
					"deer-water-*": 4,
					"deer-pudu-*": 2,
					"deer-elk-*": 9,
					"deer-pampas-*": 3,
					"*": 6
				},
				maxhealthByType: {
					"deer-redbrocket-*": 3,
					"deer-water-*": 4,
					"deer-pudu-*": 2,
					"deer-elk-*": 9,
					"deer-pampas-*": 3,
					"*": 6
				}
			},
			{
				code: "deaddecay",
				hoursToDecay: 96,
				decayedBlock: "carcass-small"
			},
			{ code: "floatupwhenstuck" },
			{
				code: "harvestable",
				drops: [
					{
						type: "item",
						code: "redmeat-raw",
						quantityByType: {
							"deer-redbrocket-*": {
								avg: 1,
								var: 0
							},
							"deer-water-*": {
								avg: 1,
								var: 0
							},
							"deer-elk-*": {
								avg: 4,
								var: 1
							},
							"deer-pampas-*": {
								avg: 1,
								var: 0
							},
							"deer-pudu-*": {
								avg: 0,
								var: 0
							},
							"*": {
								avg: 2,
								var: 1
							}
						}
					},
					{
						type: "item",
						code: "hide-raw-small",
						quantity: {
							var: 0,
							avgByType: {
								"deer-pudu-*": 0,
								"*": 1.3
							}
						}
					}
				]
			},
			{ code: "breathe" },
			{
				code: "grow",
				hoursToGrow: 672,
				orPortionsEatenForGrowing: 12,
				fedAdultEntityCodesByType: {
					"deer-elk-baby-male": ["semitameddeer-{type}-male-adult"],
					"deer-elk-baby-female": ["semitameddeer-{type}-female-adult"]
				},
				adultEntityCodesByType: {
					"*-male": ["deer-{type}-adult-male"],
					"*-female": ["deer-{type}-adult-female"]
				}
			},
			{
				code: "emotionstates",
				states: [
					{
						code: "fleeondamage",
						whenHealthRelBelow: 0.4,
						duration: 60,
						chance: 1.0,
						slot: 0,
						priority: 5,
						accumType: "max"
					},
					{
						code: "fleeondamage",
						duration: 40,
						chance: 1.0,
						slot: 0,
						priority: 1,
						accumType: "max"
					},
					{
						code: "alarmherdondamage",
						chance: 1,
						slot: 1,
						priority: 1,
						accumType: "max"
					},
					{
						code: "saturated",
						duration: 1200,
						chance: 1,
						slot: 0,
						priority: 1,
						accumType: "sum"
					}
				]
			},
			{
				code: "taskai",
				aiCreatureType: "LandCreature",
				aitasks: [
					{
						code: "fleeentity",
						animation: "Run",
						entityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						priority: 1.5,
						movespeedByType: {
							"deer-redbrocket-*": 0.05,
							"deer-water-*": 0.05,
							"deer-pudu-*": 0.05,
							"deer-pampas-*": 0.05,
							"*": 0.06
						},
						seekingRange: 20,
						animationSpeed: 2,
						instafleeOnDamageChance: 1,
						sound: "creature/hooved/generic/call*"
					},
					{
						code: "followleadholder",
						minGeneration: 2,
						priority: 1.45,
						animation: "Walk",
						animationSpeedByType: {
							"deer-elk-*": 1.15,
							"*": 1.3
						},
						movespeedByType: {
							"deer-redbrocket-*": 0.0042,
							"deer-water-*": 0.0042,
							"deer-guemal-*": 0.003,
							"deer-pudu-*": 0.003,
							"deer-elk-*": 0.0045,
							"deer-pampas-*": 0.0035,
							"*": 0.005
						}
					},
					{
						code: "stayclosetoentity",
						animation: "Trot",
						priority: 1.4,
						entityCode: "deer-{type}-adult-female",
						movespeed: 0.02,
						animationSpeed: 2.25,
						maxDistance: 5,
						searchRange: 25
					},
					{
						code: "getoutofwater",
						animation: "Swim",
						priority: 1.4,
						movespeedByType: {
							"deer-redbrocket-*": 0.03,
							"deer-water-*": 0.03,
							"deer-pudu-*": 0.03,
							"deer-pampas-*": 0.03,
							"*": 0.035
						},
						animationSpeed: 1
					},
					{
						code: "idle",
						animation: "Idle",
						priority: 0.9,
						minduration: 6000,
						maxduration: 45000,
						mincooldown: 6000,
						maxcooldown: 120000,
						priorityForCancel: 1.28,
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						stopRange: 10,
						stopOnHurt: true,
						sound: "creature/hooved/generic/sniff*"
					},
					{
						code: "idle",
						animation: "Sleep",
						priority: 1.38,
						minduration: 200000,
						maxduration: 800000,
						mincooldown: 10000,
						maxcooldown: 30000,
						priorityForCancel: 1.38,
						whenNotInEmotionState: "aggressiveondamage",
						duringDayTimeFrames: [
							{
								fromHour: 10,
								toHour: 18
							},
							{
								fromHour: 1,
								toHour: 4
							}
						],
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						stopRange: 8,
						stopOnHurt: true
					},
					{
						code: "idle",
						animation: "Sit",
						priority: 0.9,
						minduration: 6000,
						maxduration: 45000,
						mincooldown: 6000,
						maxcooldown: 120000,
						priorityForCancel: 1.28,
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						stopRange: 10,
						stopOnHurt: true
					},
					{
						code: "idle",
						animation: "Eat",
						priority: 1.2,
						priorityForCancel: 1.35,
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						minduration: 2667,
						maxduration: 2667,
						mincooldown: 6000,
						maxcooldown: 20000,
						animationSpeed: 1
					},
					{
						code: "wander",
						animation: "Walk",
						priority: 1.0,
						priorityForCancel: 1.35,
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						movespeedByType: {
							"deer-redbrocket-*": 0.0042,
							"deer-water-*": 0.0042,
							"deer-guemal-*": 0.003,
							"deer-pudu-*": 0.003,
							"deer-elk-*": 0.0045,
							"deer-pampas-*": 0.0035,
							"*": 0.005
						},
						animationSpeedByType: {
							"deer-elk-*": 1.35,
							"*": 1.55
						},
						preferredLightLevel: 12
					},
					{
						code: "wander",
						animation: "Stot",
						priority: 0.75,
						priorityForCancel: 1.35,
						movespeed: 0.015,
						animationSpeed: 1.5,
						preferredLightLevel: 12
					},
					{
						code: "wander",
						animation: "Jump",
						priority: 0.5,
						maxduration: 4000,
						priorityForCancel: 1.5,
						movespeed: 0.02,
						animationSpeed: 1.5,
						preferredLightLevel: 12
					},
					{
						code: "seekfoodandeat",
						movespeedByType: {
							"deer-redbrocket-*": 0.0042,
							"deer-water-*": 0.0042,
							"deer-guemal-*": 0.003,
							"deer-pudu-*": 0.003,
							"deer-elk-*": 0.0045,
							"deer-pampas-*": 0.0035,
							"*": 0.005
						},
						priority: 1.25,
						eatSound: "creature/animal-eat-small",
						eatTime: 1.5,
						eatLooseItems: true,
						animationSpeedByType: {
							"deer-elk-*": 1.15,
							"*": 1.3
						},
						animation: "Walk",
						eatAnimation: "Eat",
						mincooldownHours: 1,
						maxcooldownHours: 4
					},
					{
						code: "lookaround",
						priority: 0.5
					}
				]
			},
			{
				code: "pettable",
				minGeneration: 1
			},
			{ code: "entitystatetags" }
		]
	},
	sounds:{
		hurt: "creature/hooved/small/fawn/fawn*",
		death: "creature/hooved/small/fawn/fawn*",
		idle: { path: "creature/hooved/small/strange/mew*", pitch: { avg: 1, var: 0.25 } }
	},
	idleSoundChance: 0.05
}
