{
	"format_version": "1.16.100",
	"minecraft:item": {
		"description": {
			"identifier": "bridge:m249",
			"category": "Equipment"
		},
		"components": {
			"minecraft:icon": {
				"texture": "m249"
			},
			"minecraft:display_name": {
				"value": "M249 \n§7Bullets: 100 \n§7Damage: 12 \nAmmo: 5.56mm Bullet"
			},
			"minecraft:durability": {
				"max_durability": 100
			},
			"minecraft:max_stack_size": 1,
			"minecraft:hand_equipped": true,
			"minecraft:creative_category": {
				"parent": "Gun"
			},
			"minecraft:on_use": {
				"on_use": {
					"event": "fire",
					"target": "self"
				}
			},
			"minecraft:explodable": false,
			"minecraft:weapon": {
				"on_hurt_entity": {
					"event": "no_damage",
					"target": "self"
				},
				"on_not_hurt_entity": {
					"event": "no_damage",
					"target": "self"
				},
				"on_hit_block": {
					"event": "no_damage",
					"target": "self"
				}
			},
			"tag:is_gun": {},
			"tag:is_rifle": {}
		},
		"events": {
			"fire": {
				"sequence": [
					{
						"sequence": [
							{
								"condition": "query.remaining_durability >= 1",
								"sequence": [
									{
										"run_command": {
											"command": [
												"playsound item.gun.m249.fire @a ~ ~ ~ 1 1",
												"camerashake add @s 0.08 0.1 rotational"
											],
											"target": "holder"
										}
									},
									{
										"shoot": {
											"projectile": "bullet:m249",
											"launch_power": 1,
											"angle_offset": "query.cardinal_facing"
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 1,
											"target": "self"
										}
									}
								]
							},
							{
								"sequence": [
									{
										"condition": "query.remaining_durability == 100",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l99§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 99",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l98§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 98",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l97§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 97",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l96§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 96",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l95§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 95",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l94§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 94",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l93§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 93",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l92§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 92",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l91§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 91",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l90§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 90",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l89§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 89",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l88§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 88",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l87§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 87",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l86§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 86",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l85§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 85",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l84§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 84",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l83§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 83",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l82§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 82",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l81§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 81",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l80§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 80",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l79§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 79",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l78§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 78",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l77§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 77",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l76§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 76",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l75§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 75",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l74§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 74",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l73§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 73",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l72§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 72",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l71§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 71",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l70§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 70",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l69§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 69",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l68§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 68",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l67§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 67",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l66§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 66",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l65§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 65",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l64§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 64",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l63§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 63",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l62§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 62",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l61§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 61",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l60§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 60",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l59§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 59",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l58§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 58",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l57§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 57",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l56§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 56",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l55§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 55",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l54§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 54",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l53§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 53",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l52§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 52",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l51§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 51",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l50§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 50",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l49§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 49",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l48§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 48",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l47§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 47",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l46§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 46",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l45§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 45",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l44§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 44",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l43§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 43",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l42§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 42",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l41§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 41",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l40§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 40",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l39§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 39",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l38§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 38",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l37§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 37",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l36§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 36",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l35§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 35",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l34§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 34",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l33§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 33",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l32§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 32",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l31§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 31",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l30§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 30",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l29§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 29",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l28§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 28",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l27§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 27",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l26§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 26",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l25§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 25",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l24§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 24",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l23§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 23",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l22§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 22",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l21§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 21",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l20§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 20",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l19§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 90",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l18§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 18",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l17§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 17",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l16§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 16",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l15§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 15",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l14§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 14",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l13§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 13",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l12§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 12",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l11§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 11",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l10§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 10",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l9§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 9",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l8§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 8",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l7§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 7",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l6§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 6",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l5§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 5",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l4§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 4",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l3§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 3",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l2§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 2",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l1§r/100"
											],
											"target": "holder"
										}
									},
									{
										"condition": "query.remaining_durability == 1",
										"run_command": {
											"command": [
												"title @s actionbar \uE102 §l0§r/100"
											],
											"target": "holder"
										}
									}
								]
							}
						]
					},
					{
						"condition": "query.remaining_durability == 0 && query.equipped_item_any_tag('slot.weapon.offhand', '556mm')",
						"run_command": {
							"command": [
								"replaceitem entity @s slot.weapon.mainhand 0 bridge:m249 1 0",
								"clear @s bridge:ammo_556mm 0 1",
								"title @s actionbar §aReloaded",
								"playsound item.gun.reload @a ~ ~ ~ 1 1"
							],
							"target": "holder"
						}
					},
					{
						"condition": "query.remaining_durability == 0 && !query.equipped_item_any_tag('slot.weapon.offhand', '556mm')",
						"run_command": {
							"command": [
								"title @s actionbar \uE102 §l0§r/100",
								"playsound item.gun.dry_fire @a ~ ~ ~ 1 1"
							],
							"target": "holder"
						}
					}
				]
			},
			"no_damage": {
				"damage": {
					"type": "magic",
					"amount": 0,
					"target": "self"
				}
			}
		}
	}
}