{
	code: "shield",
	class: "ItemShieldFromAttributes",
	storageFlags: 257,
	attributes: {
		shield: {
			blockSoundLightByType: {
				"shield-metal": "held/shieldblock-metal-light",
				"*": "held/shieldblock-wood-light"
			},
			blockSoundHeavyByType: {
				"shield-metal": "held/shieldblock-metal-heavy",
				"*": "held/shieldblock-wood-heavy"
			},
			protectionChance: {
				"passive-projectile": 0.2,
				"active-projectile": 1,
				"passive": 0.2,
				"active": 0.9
			},
			projectileDamageAbsorptionByType: {
				"*-woodmetal": 6,
				"*-woodmetalleather": 7,
				"*-metal": 10,
			},
			damageAbsorptionByType: {
				"*-woodmetal": 4,
				"*-woodmetalleather": 4.5,
				"*-metal": 5,
			}
		},
		handbook: {
			groupBy: ["shield-{construction}-*"]
		},
		rackable: true,
		toolrackTransform: {
			translation: { x: 0.3, y: -0.62, z: -0.625 },
			rotation: { x: 91, y: -6, z: -90 },
			scale: 1.5
		},
		moldrackable: true,
		onmoldrackTransform: {
			translation: { x: 0.74, y: 0.5, z: -0.4 },
			rotation: { x: -90, y: 82, z: 90 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 1.01
		},
		antlerMountable: true,
		onAntlerMountTransform: {
			translation: { x: -0.07, y: 0.45, z: -0.44 },
			rotation: { x: 0, y: 90, z: 0 }
		},
		groundStorageTransform: {
			translation: { x: -0.42, y: -0.45, z: -0.105 },
			rotation: { x: 21, y: 179, z: -90 },
			scale: 1
		},
		// Note: variantgroups inside attributes. Used to generate all variants for the creative inventory dynamically, and for valid recipe checking
		variantGroupsByType: {
			"shield-woodmetal": {
				"metal": ["tinbronze", "bismuthbronze", "blackbronze", "gold", "silver", "iron", "meteoriciron", "steel"],
				"wood": ["aged", "birch", "oak", "maple", "pine", "acacia", "kapok", "baldcypress", "larch", "redwood", "ebony", "walnut", "purpleheart"],
				"deco": ["none"]
			},
			"shield-woodmetalleather": {
				"metal": ["tinbronze", "bismuthbronze", "blackbronze", "gold", "silver", "iron", "meteoriciron", "steel"],
				"wood": ["generic"],
				"color": ["black", "blue", "brown", "gray", "green", "orange", "pink", "purple", "red", "white", "yellow", "redblack"],
				"deco": ["none", "ornate"]
			},
			"shield-metal": {
				"metal": ["tinbronze", "bismuthbronze", "blackbronze", "gold", "silver", "iron", "meteoriciron", "steel"],
				"color": ["black", "blue", "brown", "gray", "green", "orange", "pink", "purple", "red", "white", "yellow"],
				"deco": ["none", "ornate"]
			}
		},
		durabilityGains: {
			"wood": {
				"aged": -200,
				"ebony": 30,
				"purpleheart": 20,
				"oak": 15
			},
			"metal": {
				"bismuthbronze": 20,
				"gold": -50,
				"silver": -40,
				"blackbronze": 30,
				"iron": 60,
				"meteoriciron": 90,
				"steel": 120
			}
		},
		attachableToEntity: {
			categoryCode: "shield",
			texturePrefixCode: "shield",
			attachedShape: { base: "item/tool/shield/round" }
		},
		allowedVariantsByType: {
			"shield-woodmetal": [
				{ metal: "*", wood: "*", deco: "none" },
			],
			"shield-woodmetalleather": [
				{ metal: "*", wood: "generic", color: "*", deco: "none" },
				{ metal: "*", wood: "generic", color: "black", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "blue", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "brown", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "gray", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "green", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "orange", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "pink", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "purple", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "red", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "white", deco: "ornate" },
				{ metal: "*", wood: "generic", color: "yellow", deco: "ornate" },
			],
			"shield-metal": [
				{ metal: "*", deco: "none" },
				{ metal: "*", color: "*", deco: "ornate" }
			]
		},
		// Note: textures inside attributes. Used to determine what textures to use for attribute variants
		texturesByType: {
			"shield-woodmetal": {
				"{metal}-generic-none": {
					"front": "item/tool/shield/wood.png",
					"rim": "block/metal/sheet/{metal}1.png"
				},
				"{metal}-{wood}-none": {
					"front": "block/wood/debarked/{wood}.png",
					"back": "block/wood/debarked/{wood}.png",
					"handle": "block/wood/debarked/{wood}.png",
					"rim": "block/metal/sheet/{metal}1.png"
				}
			},
			"shield-woodmetalleather": {
				"{metal}-generic-{color}-none": {
					"front": "item/tool/shield/leather/{color}.png",
					"rim": "block/metal/sheet/{metal}1.png"
				},
				"{metal}-generic-{color}-ornate": {
					"front": "item/tool/shield/ornate/{color}.png",
					"rim": "block/metal/sheet/{metal}1.png"
				}
			},
			"shield-metal": {
				"{metal}-none": {
					"front": "block/metal/plate/{metal}.png",
					"back": "block/metal/plate/{metal}.png",
					"handle": "block/metal/sheet/{metal}1.png",
					"rim": "block/metal/sheet/{metal}1.png"
				},
				"{metal}-{color}-ornate": {
					"front": "item/tool/shield/ornate/{color}.png",
					"back": "block/metal/plate/{metal}.png",
					"handle": "block/metal/sheet/{metal}1.png",
					"rim": "block/metal/sheet/{metal}1.png"
				}
			}
		}
	},
	behaviors: [{ 
		name: "GroundStorable",
		properties: {
			layout: 'WallHalves',
			wallOffY: 1,
			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 },
		}
	}],
	variantgroups: [
		{ code: "construction", states: [ "woodmetal", "woodmetalleather", "metal" ] }
	],
	shape: { base: "item/tool/shield/round" },
	durabilitybytype: {
		"shield-woodmetal": 300,
		"shield-woodmetalleather": 350,
		"shield-metal": 450
	},
	guiTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 34, y: 32, z: -163 },
		origin: { x: 0.21, y: -0.21, z: 0.49 },
		scale: 1.8
	},
	groundTransform: {
		translation: { x: 0, y: 0.37, z: 0 },
		rotation: { x: -93, y: 0, z: 0 },
		origin: { x: 0.5, y: 0, z: 0.43 },
		scale: 5
	},
	tpHandTransform: {
		translation: { x: -0.98, y: 0, z: -0.85 },
		rotation: { x: -4, y: 4, z: 0 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 1
	},
	tpOffHandTransform: {
		translation: { x: -0.13, y: 0.01, z: -0.01 },
		rotation: { x: -4, y: 173, z: 0 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 1
	}
}
