{
	code: "deer",
	class: "EntityAgent",
	tags: ["animal", "huntable", "adult", "habitat-land"],
	weight: 650,
	variantgroups: [
		{ code: "type", states: ["moose" ] },
		{ code: "age", states: ["adult"] },
		{ code: "gender", states: ["male", "female"] }
	],
	hitBoxSize: {	"x": 1.1,"y": 1.9},
	deadhitBoxSize: {	"x": 1.5,"y": 0.6},
	eyeHeight: 1.8,
	fallDamageMultiplier: 0.635,
	drops: [],
	attributes: {
		killedByInfoText: "deadcreature-killed",
		creatureDiet: {
			foodCategories: ["Vegetable", "Grain"],
			weightedFoodTags: [
				{ weight: 0.5, code: "nibbleCrop" }, 
				{ weight: 0.1, code: "grass" },
				{ weight: 0.9, code: "fruitmash" },
				{ weight: 1, code: "tastyvegetable" },
				{ weight: 0.2, code: "peanut" }
			],
			skipFoodTags: ["rice", "parsnip"]
		},
		trappable: {
			"small": { trapChance: 0.0,	trapDestroyChance: 0.3 },
			"large": { trapChance: 0.0,	trapDestroyChance: 0.5 }
		},
		handbook: {
			groupcode: "creaturegroup-moose",
			trappableGroupCode: "creaturegroup-deer-{type}-{age}"
		}
	},
	client: {
		renderer: "Shape",
		shape: { "base": "entity/animal/mammal/hooved/deer/moose/adult" },
		texture: { "base": "entity/animal/mammal/hooved/deer/moose-adult" },
		behaviors: [
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 2.1251 },
			{ code: "interpolateposition" },
			{ code: "floatupwhenstuck", "onlyWhenDead": true },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 16, belowLightLevel: 8, minSeconds: 300 },
			{ code: "antlergrowth", "enabledByType": { "*-male": true, "*": false } },
			{ 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: 0.8,
				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",
				stepHeight: 2.1251
			},
			{
				code: "despawn",
				minPlayerDistance: 8,
				belowLightLevel: 8,
				minSeconds: 300
			},
			{
				code: "health",
				currenthealth: 21,
				maxhealth: 21
			},
			{
				code: "deaddecay",
				hoursToDecay: 96,
				decayedBlock: "carcass-medium"
			},
			{
				code: "floatupwhenstuck",
				onlyWhenDead: true
			},
			{
				code: "harvestable",
				drops: [
					{
						type: "item",
						code: "redmeat-raw",
						quantity: {avg: 13, var: 3}
					},
					{
						type: "item",
						code: "hide-raw-large",
						quantity: {avg: 1.7, var: 0}
					},
					{
						type: "item",
						code: "fat",
						quantity: { avg: 2,	var: 0.3 }
					}
				]
			},
			{ code: "breathe" },
			{
				code: "emotionstates",
				states: [
					{ code: "aggressiveondamage",
						duration: 30,
						chanceByType: {
							"*-male": 0.95,
							"*-female": 0.5
						},
						slot: 0,
						priority: 2,
						accumType: "noaccum"
					},
					{
						code: "fleeondamage",
						duration: 20,
						chance: 1.0,
						slot: 0,
						priority: 5,
						accumType: "max",
						whenHealthRelBelow: 0.4
					},
					{ code: "alarmherdondamage", chance: 1, slot: 1, priority: 1, accumType: "max" },
					{ code: "saturated", duration: 1200, chance: 1,	slot: 0, priority: 1, accumType: "sum" },
					{ code: "aggressivearoundentities", 
						duration: 60, chance: 1, slot: 2, priority: 1, 
						entityCodes: ["deer-moose-male-baby", "deer-moose-female-baby"], maxGeneration: 2 
					}
				]
			},
			{
				code: "taskai",
				aiCreatureType: "LandCreature",
				aitasks: [
					{
						code: "meleeattack",
						animation: "Attack",
						entityCodes: [ "player", "wolf-*", "bear-*", "hyena-*", "fox-*" ],
						priority: 3,
						damageByType: {
							"*-male": 12,
							"*-female": 9
						},
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 1500,
						maxcooldown: 2500,
						attackDurationMs: 1250,
						damagePlayerAtMs: 500,
						animationSpeed: 2.5,
						sound: "creature/hooved/generic/sniff*"
					},
					{
						code: "seekentity",
						animation: "Charge",
						enabledByType: {
							"*-male": true,
							"*": false
						},
						entityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						priority: 1.6,
						mincooldown: 600,
						maxcooldown: 650,
						movespeed: 0.036,
						seekingRange: 20,
						animationSpeed: 1,
						sound: "creature/hooved/generic/sniff*",
						whenNotInEmotionState: "fleeondamage"
					},
					{
						code: "fleeentity",
						instafleeOnDamageChance: 1,
						animation: "Run",
						entityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						priority: 1.51,
						movespeed: 0.05,
						seekingRange: 14,
						animationSpeed: 1.8,
						sound: "creature/hooved/generic/sniff*",
						whenNotInEmotionState: "aggressiveondamage"
					},
					{
						code: "followleadholder",
						minGeneration: 2,
						priority: 1.45,
						animation: "Walk",
						movespeed: 0.0055,
						animationSpeed: 1.13
					},
					{
						code: "getoutofwater",
						animation: "Swim",
						priority: 1.4,
						movespeed: 0.0045,
						animationSpeed: 0.8
					},
					{
						code: "idle",
						animation: "Sleep",
						priority: 1.38,
						minduration: 200000,
						maxduration: 800000,
						mincooldown: 10000,
						maxcooldown: 30000,
						priorityForCancel: 1.38,
						whenNotInEmotionState: "aggressiveondamage",
						duringDayTimeFrames: [
							{ fromHour: 18, toHour: 10 }
						],
						stopOnNearbyEntityCodes: [ "player", "wolf-*", "hyena-*", "bear-*" ],
						stopRange: 8,
						stopOnHurt: true
					},
					{
						code: "seekfoodandeat",
						movespeed: 0.0055,
						priority: 1.25,
						eatSound: "creature/animal-eat-small",
						eatTime: 1.5,
						eatLooseItems: true,
						animationSpeed: 1.13,
						animation: "Walk",
						eatAnimation: "Eat",
						mincooldownHours: 1,
						maxcooldownHours: 4
					},
					{
						code: "idle",
						animation: "Eat",
						priority: 1.2,
						priorityForCancel: 1.35,
						minduration: 2667,
						maxduration: 2667,
						mincooldown: 6000,
						maxcooldown: 20000,
						animationSpeed: 1.5
					},
					{
						code: "idle",
						animation: "Roar",
						priority: 1.0,
						priorityForCancel: 1.35,
						minduration: 4667,
						maxduration: 4667,
						chance: 0.1,
						mincooldown: 8000,
						maxcooldown: 50000,
						animationSpeed: 1.0,
						sound: "creature/hooved/generic/sniff*",
						soundRange: 30
					},
					{
						code: "wander",
						animation: "Walk",
						priority: 1.0,
						priorityForCancel: 1.35,
						movespeed: 0.0055,
						animationSpeed: 1.2,
						preferredLightLevel: 12
					},
					{
						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: "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: "lookaround",
						priority: 0.5
					}
				]
			},
			{
				code: "pettable",
				minGeneration: 4
			},
			{
				"code": "antlergrowth",
				"enabledByType": { "*-male": true, "*": false },
				"variants": ["01", "02", "03", "04", "05", "06", "07", "08"],
				"beginGrowMonth": 4,
				
				"c1": "Amount of months until full growth. Must be less than 9 months (including grown and she duration)",
				"growDurationMonths": 5,
				
				"c2": "Amount of months the antler can be at full growth until shedding",
				"grownDurationMonths": 3,
				
				"c3": "Amount of months the antler can shed. Higher values allows players to find them for longers. A value of 0 will make antlers never drop",
				"shedDurationMonths": 2
			}
		],
		spawnconditions: {
			worldgen: {
				triesPerChunkByType: { 
					"*-male": {avg: 0.0015, var: 0 },
					"*-female": {avg: 0.0015, var: 0 }
				},
				tryOnlySurface: true,
				groupSize: { "dist": "verynarrowgaussian", avg: 2, var: 1.0 },
				insideBlockCodes: ["air", "tallgrass-*", "snowlayer-1", "flower-*"],
				companionsByType: {
					"*-male": ["deer-moose-adult-female"],
					"*-female": ["deer-moose-baby-male", "deer-moose-baby-female"]
				}
			},
			runtime: {
				group: "neutral",
				MinDistanceToPlayer: 30,
				tryOnlySurface: true,
				chanceByType: {
					"*-male": 0.00025,
					"*-female": 0.00025
				},
				minLightLevel: 10,
				maxQuantity: 2,
				maxQuantityByGroup: { code: "deer-moose-*", "maxQuantity": 4 },
				groupSize: { dist: "invexp", avg: 2.0, var: 1.0 },
				insideBlockCodes: [ "air", "tallgrass-*", "snowlayer-1", "flower-*"],
				companionsByType: {
					"*-male": ["deer-moose-adult-female"],
					"*-female": ["deer-moose-baby-male", "deer-moose-baby-female"]
				}
			},
			climate: {
				minTemp: -19,
				maxTemp: -4,
				minRain: 0.35,
				minForestOrShrubs: 0.35,
				maxForest: 0.95,
				maxShrubs: 0.95,
				minY: 0.9,
				maxY: 1.5					
			}
		}
	},
	sounds:{
		hurt: "creature/hooved/large/redstag/roar*",
		death: "creature/animal/mammal/hooved/deer/elk-bugle*",
		idle: { path: "creature/hooved/large/redstag/bellow*", pitch: { avg: 1, var: 0.25 } }
	},
	idleSoundChance: 0.05
}
