{
	code: "hare",
	class: "EntityAgent",
	tags: ["animal", "huntable", "adult", "habitat-land"],
	weight: 4,
	variantgroups:  [ 
		{ code: "type", states: ["arctic", "cape", "european", "indian", "jackblack", "scrub"]},
		{ code: "age", states: ["adult"] },
		{ code: "gender", states: ["male", "female"] }
	] ,
	hitboxSize: { x: 0.75, y: 0.5 },
	attributes: {
		creatureDiet: {
			foodCategories: ["Vegetable"],
			weightedFoodTags: [
				{ weight: 0.5, code: "nibbleCrop" }, 
				{ weight: 1, code: "tastyvegetable" },
				{ weight: 0.2, code: "cassava" }
			]
		},
		trappable: {
			"small": { trapChance: 0.5, trapDestroyChance: 0.01 }
		},
		handbook: {
			"groupcode": "creaturegroup-hare",
			trappableGroupCode: "creaturegroup-hare-{type}-{age}"
		}
	},
	eyeHeight: 0.6,
	drops: [

	],
	client: {
		renderer: "Shape",
		shapeByType: {
			"*":	{ base: "entity/animal/mammal/hare/european-{gender}" }
		},
		textures: { 
			"skin": { base: "entity/animal/mammal/hare/{type}-{gender}*" }
		},
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "interpolateposition" },
			{ code: "multiply", "enabledByType": { "*-female": true, "*": false } },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 200 },
			{ code: "ropetieable", minGeneration: 2 }
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt", 
				animationSpeed: 2.2,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "dig",
				animation: "dig", 
				animationSpeed: 1
			},
			{
				code: "longdig",
				animation: "longdig", 
				animationSpeed: 1
			},
			{
				code: "die",
				animation: "death", 
				animationSpeed: 1.25,
				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"
			}
		]
	},
	server: {
		behaviors: [
			{ code: "ropetieable", minGeneration: 2 },
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 300 },
			{ code: "health", currenthealth: 3, maxhealth: 3 },
			{ code: "deaddecay", hoursToDecay: 96, decayedBlock: "carcass-tiny" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable", 
				drops: [
					{
						type: "item", 
						code: "redmeat-raw", 
						quantity: { avg: 2, var: 0 } 
					},
					{ type: "item",
						code: "hide-raw-small",
						quantity: { avg: 0.5, var: 0 } 
					}
				]
			},
			{ code: "breathe" },
			{ 
				code: "multiply",
				enabledByType: { "*-female": true, "*": false },
				spawnEntityCodes: [ {"code":"hare-{type}-baby-male"}, {"code": "hare-{type}-baby-female"} ],
				requiresNearbyEntityCode: "hare-*-adult-male",
				requiresNearbyEntityRange: 10,
				spawnQuantityMin: 1,
				spawnQuantityMax: 4,
				eatAnyway: true,
				pregnancyDays: 5,
				multiplyCooldownDaysMin: 2,
				multiplyCooldownDaysMax: 5,
				portionsEatenForMultiply: 2
			},
			{ 
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 10, chance: 1, slot: 0, priority: 1, accumType: "max" },
					{ code: "saturated", duration: 1200, chance: 1, slot: 0, priority: 1, accumType: "sum" }
				]
			},
			{ 
				code: "taskai",
				aiCreatureType: "LandCreature",
				aitasks: [
					{
						code: "fleeentity",
						entityCodes: ["player", "wolf-*", "fox-*", "hyena-*", "bear-*"],
						priority: 2,
						movespeed: 0.06,
						seekingRange: 14,
						instafleeOnDamageChance: 1,
						animation: "Run",
						animationSpeed: 2
					},
					{
						code: "followleadholder",
						minGeneration: 2,
						priority: 1.45,
						animation: "walk",
						animationSpeed: 2,
						movespeed: 0.015
					},
					{
						code: "stayclosetoentity",
						enabledByType: {
							"*-adult-female": true,
							"*": false
						},
						priority: 1.4,
						entityCode: "hare-{type}-adult-male",
						movespeed: 0.02,
						animationSpeed: 3,
						maxDistance: 5,
						searchRange: 25,
						animation: "Run"
					},
					{
						code: "getoutofwater",
						priority: 1.4,
						movespeed: 0.015,
						animation: "Walk",
						animationSpeed: 2.2
					},
					{
						code: "idle",
						priority: 1.38,
						minduration: 200000,
						maxduration: 800000,
						mincooldown: 10000,
						maxcooldown: 30000,
						priorityForCancel: 1.38,
						animation: "Sleep",
						whenNotInEmotionState: "aggressiveondamage",
						duringDayTimeFrames: [ { fromHour: 10, toHour: 18 }, { fromHour: 1, toHour: 4 } ],
						stopOnNearbyEntityCodes: ["player", "wolf-*", "fox-*", "hyena-*", "bear-*"],
						stopRange: 8,
						stopOnHurt: true
					},
					{
						code: "seekfoodandeat",
						movespeed: 0.010,
						priority: 1.25,
						eatTime: 2.3,
						eatLooseItems: true,
						animationSpeed: 1.4,
						animation: "Walk",
						eatAnimation: "longdig",
						mincooldownHours: 1,
						maxcooldownHours: 4
					},
					{
						code: "idle",
						priority: 1.2,
						priorityForCancel: 1.35,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 6000,
						maxcooldown: 20000,
						animation: "Sniff",
						animationSpeed: 1.25
					},
					{
						code: "idle",
						priority: 1.1,
						priorityForCancel: 1.35,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 6000,
						maxcooldown: 20000,
						animation: "Dig",
						animationSpeed: 1
					},
					{
						code: "idle",
						priority: 1.1,
						priorityForCancel: 1.35,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 12000,
						maxcooldown: 40000,
						animation: "longDig",
						animationSpeed: 1
					},
					{
						code: "idle",
						priority: 1.1,
						minduration: 1000,
						maxduration: 3000,
						mincooldown: 2000,
						maxcooldown: 30000,
						animation: "Idle"
					},
					{
						code: "wander", 
						priority: 1.0, 
						priorityForCancel: 1.35,
						movespeed: 0.01,
						animation: "Walk",
						preferredLightLevel: 20
					},
					{
						code: "idle",
						priority: 0.9,
						minduration: 5000,
						maxduration: 30000,
						mincooldown: 2000,
						maxcooldown: 120000,
						priorityForCancel: 1.28,
						animation: "Sit"
					},
					{ 
						code: "lookaround", 
						priority: 0.5
					}
				]
			},
			{ code: "entitystatetags" }
		],
		spawnconditionsByType: {
			"*-arctic-adult-male": {
				worldgen: {
					TriesPerChunk: { avg: 0.075, var: 0 },
					tryOnlySurface: true,
					"__comment": "Make them spawn avoid from block light so they don't spawn inside farmland",
					maxLightLevel: 8,
					lightLevelType: "onlyBlockLight",					
					groupSize: { dist: "verynarrowgaussian", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				runtime: {
					group: "neutral",
					chance: 0.001,
					tryOnlySurface: true,
					maxQuantity: 3,
					"__comment": "Make them spawn avoid from block light so they don't spawn inside farmland",
					maxLightLevel: 8,
					lightLevelType: "onlyBlockLight",					
					groupSize: { dist: "verynarrowgaussian", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				climate: {
					minTemp: -70,
					maxTemp: -8,
					minRain: 0.25,
					minForestOrShrubs: 0.25,
					maxForest: 0.75,
					maxShrubs: 0.75,
				}
			},
			"*-cape-adult-male": {
				worldgen: {
					TriesPerChunk: { avg: 0.075, var: 0 },
					tryOnlySurface: true,
					"__comment": "Make them spawn in dark places so they don't spawn inside farmland",
					maxLightLevel: 8,
					lightLevelType: "maxTimeOfDayLight",					
					groupSize: { dist: "verynarrowgaussian", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				runtime: {
					group: "neutral",
					chance: 0.001,
					tryOnlySurface: true,
					"__comment": "Make them spawn in dark places so they don't spawn inside farmland",
					maxLightLevel: 8,
					maxQuantity: 3,
					lightLevelType: "maxTimeOfDayLight",					
					groupSize: { dist: "verynarrowgaussian", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				climate: {
					minTemp: 22,
					maxTemp: 40,
					minRain: 0.2,
					maxRain: 0.45,
					minForestOrShrubs: 0.25,
					maxForest: 0.75,
					maxShrubs: 0.75,
				}
			},
			"*-european-adult-male": {
				worldgen: {
					TriesPerChunk: { avg: 0.14, var: 0 },
					tryOnlySurface: true,
					groupSize: { dist: "uniform", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				runtime: {
					group: "neutral",
					tryOnlySurface: true,
					chance: 0.007,
					maxQuantity: 3,
					"__comment": "Make them spawn away from artifical light so they don't spawn inside farmland",
					maxLightLevel: 6,
					lightLevelType: "onlyBlockLight",					
					groupSize: { dist: "uniform", avg: 1, var: 3 },
					insideBlockCodes: ["tallgrass-*", "snowlayer-1"],
					companions: ["hare-{type}-adult-female", "hare-{type}-baby-male", "hare-{type}-baby-female"]
				},
				climate: {
					minTemp: -5,
					maxTemp: 25,
					minRain: 0.3,
					maxRain: 0.9,
					minForestOrShrubs: 0.25,
					maxForest: 0.75,
					maxShrubs: 0.75
				}
			}
		}
	},
	sounds: {
		hurt: "creature/hare-hurt",
		death: "creature/hare-hurt",
		idle: { path: "creature/hare-idle", pitch: { avg: 1, var: 0.25 } }
	},
	idleSoundChance: 0.03
}
