{
	code: "spear",
	classByType: {
		"spear-generic-hacking": "ItemHackingSpear",
		"*": "ItemSpear",
	},
	tags: ["weapon", "weapon-melee", "weapon-spear"],
	damagedby: ["attacking"],
	tool: "spear",
	behaviors: [
		{ name: "GroundStorable", properties: { layout: 'WallHalves', wallOffYByType:{ "@spear-generic-(chert|granite|andesite|basalt|obsidian|peridotite|flint)": 2, "*": 3 }, ctrlKey: true, selectionBox: { x1: 0, y1: 0, z1: 0, x2: 1, y2: 0.1, z2: 1 }, collisionBox: { x1: 0, y1: 0, z1: 0, x2: 0, y2: 0, z2: 0 } } },
		{ name: "AnimationAuthoritative" }
	],
	variantgroups: [
		{ code: "type", states: ["generic", "scrap", "boar", "voulge", "fork", "ranseur"] },
		{ code: "material", states: ["chert", "granite", "andesite", "basalt", "obsidian", "peridotite", "flint", "scrap", "copper", "tinbronze", "bismuthbronze", "blackbronze", "ornategold", "ornatesilver", "hacking", "ruined", "erel", "iron", "meteoriciron", "steel"] },
	],
	skipVariants: [
		"spear-generic-ruined",
		"spear-generic-scrap"
	],
	allowedVariants: [
		"spear-generic-*",
		"spear-scrap-scrap",
		"spear-boar-ruined",
		"spear-voulge-ruined",
		"spear-fork-ruined",
		"spear-ranseur-ruined"
	],
	shapeByType: {
		"spear-generic-erel": { base: "entity/nonliving/projectile/erel-large-usable" },
		"spear-scrap-scrap": { base: "item/tool/spear/scrap" },
		"spear-generic-hacking": { base: "item/tool/spear/hacking" },
		"spear-generic-ornategold": { base: "item/tool/spear/ornategold" },
		"spear-generic-ornatesilver": { base: "item/tool/spear/ornatesilver" },
		"@spear-generic-(chert|granite|andesite|basalt|obsidian|peridotite|flint)": { base: "item/tool/spear/stone" },
		"@spear-generic-(copper|tinbronze|bismuthbronze|blackbronze|iron|meteoriciron|steel)": { base: "item/tool/spear/metal-{material}" },
		"*-ruined": { base: "item/tool/spear/ruined/{type}" }
	},
	texturesByType: {
		"spear-generic-flint": { 
			"stone": { base: "block/stone/{material}" } 
		},
		"@spear-generic-(chert|granite|andesite|basalt|obsidian|peridotite)": { 
			"stone": { base: "block/stone/rock/{material}1" } 
		},
		"@spear-generic-(copper|tinbronze|bismuthbronze|blackbronze|iron|meteoriciron|steel)": { 
			"ingot": { base: "block/metal/ingot/{material}" } 
		}
	},
	heldTpIdleAnimation: "spearidle",
	heldRightReadyAnimation: "spearidle",
	heldTpHitAnimation: "spearhit",
	attackRange: 3.5,
	attackpowerbytype: {
		"spear-generic-chert": 1.75,
		"spear-generic-granite": 1.75,
		"spear-generic-andesite": 1.75,
		"spear-generic-peridotite": 1.75,
		"spear-generic-basalt": 1.75,
		"spear-generic-flint": 2,
		"spear-generic-obsidian": 2.25,
		"spear-scrap-scrap": 2.75,
		"spear-generic-copper": 2.75,
		"spear-generic-erel": 3,
		"spear-generic-bismuthbronze": 3.25,
		"spear-generic-tinbronze": 3.75,
		"spear-generic-blackbronze": 4,
		"spear-generic-hacking": 2,
		"spear-generic-ornategold": 4.25,
		"spear-generic-ornatesilver": 4.25,
		"*-ruined": 4,
		"spear-generic-iron": 4.2,
		"spear-generic-meteoriciron": 4.3,
		"spear-generic-steel": 4.4
	},
	attributes: {
		heldItemPitchFollow: 1,
		groundStorageTransformByType: {
			"spear-generic-hacking": {
				translation: { x: -0.45, y: 0.35, z: 0.2 },
				rotation: { x: 16, y: 1, z: 90 },
				scale: 0.85
			},
			"spear-scrap-scrap": {
				translation: { x: 0, y: 0.25, z: 0.546 },
				rotation: { x: 16, y: 90, z: 90 },
				scale: 0.85
			},
			"spear-boar-ruined": {
				translation: { x: 0, y: 0.65, z: 0.61 },
				rotation: { x: 16, y: 90, z: 90 },
				scale: 0.85
			},
			"spear-voulge-ruined": {
				translation: { x: 0.24, y: 0.65, z: 0.516 },
				rotation: { x: 16, y: 130, z: 90 },
				scale: 0.85
			},
			"spear-fork-ruined": {
				translation: { x: -0.25, y: 0.65, z: 0.11 },
				rotation: { x: 16, y: 0, z: 90 },
				scale: 0.85
			},
			"spear-ranseur-ruined": {
				translation: { x: 0, y: 0.93, z: -0.11 },
				rotation: { x: 16, y: -90, z: 90 },
				scale: 0.85
			},
			"@spear-generic-(copper|tinbronze|bismuthbronze)": {
				translation: { x: -0.39, y: 0.78, z: 0.235 },
				rotation: { x: 16, y: 1, z: 90 },
				scale: 0.85
			},
			"@spear-generic-(blackbronze|iron|meteoriciron|steel)": {
				translation: { x: -0.39, y: 0.78, z: 0.2 },
				rotation: { x: 16, y: 1, z: 90 },
				scale: 0.85
			},
			"spear-generic-ornate*": {
				translation: { x: -0.39, y: 0.72, z: 0.25 },
				rotation: { x: 16, y: 1, z: 90 },
				scale: 0.81
			},
			"*": {
				translation: { x: 0, y: 0.26, z: 0.596 },
				rotation: { x: 16, y: 90, z: 90 },
				scale: 0.85
			}
		},
		hackingByType: {
			"*-hacking": true
		},
		// Thrown damage
		damageByType: {
			"*-chert": 2.5,
			"*-granite": 2.5,
			"*-andesite": 2.5,
			"*-peridotite": 2.5,
			"*-basalt": 2.5,
			"*-flint": 3.25,
			"*-obsidian": 3.75,
			"*-scrap": 4.25,
			"*-copper": 4.25,
			"*-erel": 5.75,
			"*-bismuthbronze": 4.5,
			"*-tinbronze": 5.25,
			"*-blackbronze": 5.5,
			"*-ruined": 8,
			"*-hacking": 7,
			"*-ornategold": 8.25,
			"*-ornatesilver": 8.25,
			"*-iron": 6,
			"*-meteoriciron": 6.1,
			"*-steel": 6.2
		},
		damageTierByType: {
			"*-chert": 0,
			"*-granite": 0,
			"*-andesite": 0,
			"*-peridotite": 0,
			"*-basalt": 0,
			"*-flint": 0,
			"*-obsidian": 0,
			"*-scrap": 0,
			"*-copper": 0,
			"*-erel": 0,
			"*-bismuthbronze": 0,
			"*-tinbronze": 0,
			"*-blackbronze": 0,
			"*-ruined": 0,
			"*-hacking": 0,
			"*-ornategold": 0,
			"*-ornatesilver": 0,
			"*-iron": 1,
			"*-meteoriciron": 1,
			"*-steel": 2
		},
		spearEntityCodeByType: {
			"spear-generic-erel": "erelprojectile-large-usable",
			"*": "spear-{type}-{material}",
		},
		handbook: {
			groupBy: ["spear-*"]
		},
		toolrackTransformByType: {
			"spear-generic-erel": {
				translation: { x: 0.55, y: 0.5, z: 0 },
				rotation: { x: 0, y: 1, z: -1 },
				scale: 1
			},
			"spear-scrap-scrap": {
				rotation: { x: 0, y: 1, z: -1 },
				translation: { x: -0.35, y: 0.7, z: 0 },
				scale: 1.36
			},
			"spear-voulge-ruined": {
				translation: { x: 0.3, y: 0.4, z: 0.7 },
				rotation: { x: 60, y: 1, z: -1 },
				scale: 1.37
			},
			"spear-fork-ruined": {
				translation: { x: 0.95, y: -0.27, z: 0.6 },
				rotation: { x: 125, y: 1, z: -1 },
				scale: 1.36
			},
			"spear-ranseur-ruined": {
				translation: { x: 0.56, y: 0.05, z: 0.6 },
				rotation: { x: 89, y: 1, z: -1 },
				scale: 1.36
			},
			"spear-boar-ruined": {
				translation: { x: 0.45, y: 0.05, z: 0.7 },
				rotation: { x: 89, y: 1, z: -1 }
			},
			"@spear-generic-(copper|tinbronze|bismuthbronze|blackbronze|ornategold|hacking|ornatesilver|iron|meteoriciron|steel)": {
				rotation: { x: 90, y: 1, z: -1 },
				translation: { x: 0.31, y: 0.04, z: 0.7 },
				scale: 1.36
			},
			"spear-generic-hacking": {
				rotation: { x: 90, y: 1, z: -1 },
				translation: { x: -0.19, y: 0.04, z: 0.7 },
				scale: 1.36
			},
			"*": {
				rotation: { y: 1, z: -1 },
				translation: { x: -0.23, y: 0.66 },
				scale: 1.36
			}
		},
		rangedWeaponsSpeedMul: 0.66,
		texturesByType: {
			"axe-scrap-scrap": { },
			"axe-felling-*": {
				"material": { base: "block/metal/ingot/{material}" }
			}
		},
		antlerMountable: true,
		onAntlerMountTransformByType: {
			"spear-scrap-scrap": {
				translation: { x: -0.39, y: 0.533, z: -0.18 },
				rotation: { x: -90, y: 0, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-boar-ruined": {
				translation: { x: -0.406, y: 0.533, z: 0.12 },
				rotation: { x: -90, y: -80, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-fork-ruined": {
				translation: { x: -0.406, y: 0.533, z: 0.24 },
				rotation: { x: -90, y: 42, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-ranseur-ruined": {
				translation: { x: -0.406, y: 0.533, z: 0.25 },
				rotation: { x: -90, y: 90, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-voulge-ruined": {
				translation: { x: -0.406, y: 0.533, z: 0.12 },
				rotation: { x: -90, y: -59, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-generic-hacking": {
				translation: { x: -0.406, y: 0.5, z: -0.14 },
				rotation: { x: -90, y: -90, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"spear-generic-*": {
				translation: { x: -0.406, y: 0.5, z: 0.15 },
				rotation: { x: -90, y: -90, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			},
			"*": {
				translation: { x: -0.406, y: 0.533, z: 0.12 },
				rotation: { x: -90, y: 0, z: -90 },
				origin: { x: 0.5, y: 0, z: 0.5 },
				scale: 0.8
			}			
		}
	},
	durabilitybytype: {
		"spear-generic-chert": 16,
		"spear-generic-granite": 16,
		"spear-generic-andesite": 16,
		"spear-generic-basalt": 16,
		"spear-generic-peridotite": 16,
		"spear-generic-obsidian": 45,
		"spear-generic-flint": 32,
		"spear-scrap-scrap": 80,
		"spear-generic-copper": 140,
		"spear-generic-tinbronze": 220,
		"spear-generic-bismuthbronze": 260,
		"spear-generic-blackbronze": 300,
		"spear-generic-hacking": 250,
		"spear-generic-ornategold": 320,
		"spear-generic-ornatesilver": 320,
		"*-ruined": 15,
		"*-erel": 2,
		"spear-generic-iron": 400,
		"spear-generic-meteoriciron": 450,
		"spear-generic-steel": 700
	},
	creativeinventory: { "general": ["*"], "items": ["*"], "tools": ["*"] },
	guiTransformByType: {
		"*-erel": {
			translation: { x: -0.1, y: 0, z: 0 },
			rotation: { x: -60, y: 124, z: 6 },
			origin: { x: 0.39, y: 0, z: 0.5 },
			scale: 2.26
		},
		"spear-generic-hacking": {
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: 23, y: -180, z: -52 },
			origin: { x: 1.43, y: 0, z: 0.52 },
			scale: 2.26
		},
		"spear-scrap-scrap": {
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: -60, y: 124, z: 6 },
			origin: { x: 1.54, y: 0, z: 0.5 },
			scale: 2.26
		},
		"spear-boar-ruined": {
			rotation: { x: 2, y: 157, z: -46 },
			origin: { x: 1.39, y: -0, z: 0.5 },
			scale: 2.26
		},
		"spear-fork-ruined": {
			rotation: { x: -17, y: 144, z: -37 },
			origin: { x: 1.39, y: 0.05, z: 0.5 },
			scale: 2
		},
		"spear-voulge-ruined": {
			rotation: { x: -180, y: 128, z: 38 },
			origin: { x: 1.29, y: 0, z: 0.5 },
			scale: 2.26
		},
		"spear-ranseur-ruined": {
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: -175, y: 140, z: 38 },
			origin: { x: 1.19, y: 0, z: 0.6 },
			scale: 2.26
		},
		"spear-generic-ornategold": {
			rotation: { x: -16, y: -2, z: -134 },
			origin: { x: 1.47, y: 0.05, z: 0.5 },
			scale: 3.09
		},
		"spear-generic-ornatesilver": {
			rotation: { x: -16, y: -2, z: -134 },
			origin: { x: 1.47, y: 0.05, z: 0.5 },
			scale: 3.09
		},
		"@spear-generic-(copper|tinbronze|bismuthbronze|blackbronze|iron|meteoriciron|steel)": {
			rotation: { x: 33, y: 0, z: -127 },
			origin: { x: 1.39, y: 0.05, z: 0.52 },
			scale: 2.26
		},
		"*": {
			rotation: { x: -39, y: -29, z: -134 },
			origin: { x: 1.4, y: 0.05, z: 0.5 },
			scale: 3.09
		}
	},
	groundTransformByType: {
		"spear-scrap-scrap": {
			translation: { x: 0, y: 0.05, z: 0 },
			rotation: { x: 0, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 3.4
		},
		"spear-voulge-ruined": {
			translation: { x: 0, y: 0.05, z: 0 },
			rotation: { x: 68, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 3.4
		},
		"spear-fork-ruined": {
			translation: { x: 0, y: 0.05, z: 0 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 3.4
		},
		"*": {
			translation: { x: 0, y: 0.05, z: 0 },
			rotation: { x: 90, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 3.4
		}
	},
	tpHandTransformByType: {
		"spear-scrap-scrap": {
			translation: { x: -1.14, y: 0.01, z: -0.6 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.6, y: 0, z: 0.5 },
			scale: 0.8
		},
		"spear-voulge-ruined": {
			translation: { x: -1.24, y: 0.03, z: -0.61 },
			rotation: { x: 0, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 0.8
		},
		"@spear-generic-(copper|tinbronze|bismuthbronze|blackbronze|hacking|iron|meteoriciron|steel)": {
			translation: { x: -1.29, y: 0.03, z: -0.57 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.6, y: 0, z: 0.5 },
			scale: 0.8
		},
		"@spear-generic-(ornategold|ornatesilver)": {
			translation: { x: -1.04, y: 0.02, z: -0.57 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 0.8
		},
		"*-ruined": {
			translation: { x: -1.24, y: 0.03, z: -0.61 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 0.8
		},
		"*": {
			translation: { x: -1.29, y: 0.02, z: -0.57 },
			rotation: { x: -90, y: 0, z: 0 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 0.8
		}
	}
}
