{
	"format_version": "1.16.100",
	"minecraft:item": {
		"description": {
			"identifier": "knights:netherite_morgenstern",
			"category": "Equipment"
		},
		"components": {
			"minecraft:creative_category": {
				"parent": "itemGroup.name.sword"
			},
			"tag:minecraft:is_mace": {},
			"minecraft:icon": {
				"texture": "knights_netherite_morgenstern"
			},
			"minecraft:durability": {
				"max_durability": 2031,
				"damage_chance": {
					"min": 60,
					"max": 100
				}
			},
			"minecraft:repairable": {
				"repair_items": [
					{
						"items": [
							"minecraft:netherite_ingot"
						],
						"repair_amount": 280
					},
					{
						"items": [
							"knights:netherite_morgenstern"
						],
						"repair_amount": "query.max_durability"
					}
				]
			},
			"minecraft:use_duration": 1000,
			"minecraft:display_name": {
				"value": "Netherite Morgenstern"
			},
			"minecraft:max_stack_size": 1,
			"minecraft:hand_equipped": true,
			"minecraft:mining_speed": 1.5,
			"minecraft:damage": 12,
			"minecraft:enchantable": {
				"value": 12,
				"slot": "sword"
			},
			"minecraft:can_destroy_in_creative": false,
			"minecraft:digger": {
				"use_efficiency": true,
				"destroy_speeds": [
					{
						"block": "minecraft:web",
						"speed": 15,
						"on_dig": {
							"event": "minecraft:break"
						}
					},
					{
						"block": "minecraft:bamboo",
						"speed": 10,
						"on_dig": {
							"event": "minecraft:break"
						}
					}
				],
				"on_dig": {
					"event": "minecraft:break",
					"target": "self"
				}
			},
			"minecraft:weapon": {
				"on_hurt_entity": {
					"event": "minecraft:break"
				}
			},
			"minecraft:cooldown": {
				"category": "mace",
				"duration": 3
			},
			"minecraft:on_use": {
				"on_use": {
					"event": "active",
					"target": "self"
				}
			}
		},
		"events": {
			"active": {
				"sequence": [
					{
						"condition": "query.scoreboard('exhaust')>=7&&query.scoreboard('mace_cd')<2&&!query.is_sneaking",
						"run_command": {
							"command": [
								"tag @s add jidder",
								"summon pixel:hit ^^^1 damage:medium",
								"scoreboard players remove @s exhaust 0",
								"playanimation @s animation.mace.ability_smash default",
								"scoreboard objectives add mace_cd dummy",
								"scoreboard players set @s mace_cd 20"
							]
						}
					},
					{
						"condition": "query.scoreboard('exhaust')>=7&&query.scoreboard('mace_cd')<2&&query.scoreboard('mcabltsnk')==0&&query.is_sneaking",
						"run_command": {
							"command": [
								"scoreboard players remove @s exhaust 0",
								"scoreboard objectives add ignrrmr dummy",
								"scoreboard players set @s ignrrmr 1",
								"playanimation @s animation.mace.ability_strengthen default",
								"particle pixel:strengthen_aura ~ ~ ~",
								"tell @s next strike ignores armor"
							]
						}
					},
					{
						"condition": "query.scoreboard('exhaust')>=13&&query.scoreboard('mace_cd')<2&&query.scoreboard('mcabltsnk')==1&&query.is_sneaking",
						"run_command": {
							"command": [
								"scoreboard players remove @s exhaust 0",
								"playanimation @s animation.mace.ability_strengthen default",
								"particle pixel:hatred_aura ~ ~ ~",
								"scoreboard objectives add knckdwn dummy",
								"scoreboard players set @s knckdwn 1"
							]
						}
					}
				]
			},
			"minecraft:break": {
				"sequence": [
					{
						"condition": "query.scoreboard('mdmmstr')<=0&&query.scoreboard('mdmmstr')<50",
						"sequence": [
							{
								"run_command": {
									"command": [
										"scoreboard objectives add mace_cd dummy",
										"tag @s remove hevh",
										"scoreboard players set @s mace_cd 40",
										"scoreboard players remove @s exhaust 0",
										"effect @s weakness 2 20"
									]
								}
							},
							{
								"condition": "query.scoreboard('ignrrmr')==1",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 7,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 3,
											"target": "other"
										}
									},
									{
										"run_command": {
											"command": [
												"scoreboard players set @s ignrrmr 0"
											]
										}
									}
								]
							},
							{
								"condition": "!query.is_riding&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 3,
											"amplifier": 2
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 1,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "!query.is_on_ground&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 9,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 2,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "query.is_riding&&query.scoreboard('mace_cd')<2",
								"damage": {
									"type": "magic",
									"amount": 1,
									"target": "other"
								},
								"add_mob_effect": {
									"effect": "slowness",
									"target": "other",
									"duration": 2,
									"amplifier": 3
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('mdmmstr')>=50&&query.scoreboard('mdmmstr')<100",
						"sequence": [
							{
								"run_command": {
									"command": [
										"scoreboard objectives add mace_cd dummy",
										"tag @s remove hevh",
										"scoreboard players set @s mace_cd 40",
										"scoreboard players remove @s exhaust 0",
										"effect @s weakness 2 20"
									]
								},
								"damage": {
									"type": "entity_attack",
									"amount": 1,
									"target": "other"
								}
							},
							{
								"condition": "query.scoreboard('ignrrmr')==1",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 7,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 4,
											"target": "other"
										}
									},
									{
										"run_command": {
											"command": [
												"scoreboard players set @s ignrrmr 0"
											]
										}
									}
								]
							},
							{
								"condition": "!query.is_riding&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 5,
											"amplifier": 2
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 2,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "!query.is_on_ground&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 9,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 3,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "query.is_riding&&query.scoreboard('mace_cd')<2",
								"damage": {
									"type": "magic",
									"amount": 1,
									"target": "other"
								},
								"add_mob_effect": {
									"effect": "slowness",
									"target": "other",
									"duration": 2,
									"amplifier": 2
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('mdmmstr')>=100&&query.scoreboard('mdmmstr')<1000",
						"sequence": [
							{
								"run_command": {
									"command": [
										"scoreboard objectives add mace_cd dummy",
										"tag @s remove hevh",
										"scoreboard players set @s mace_cd 20",
										"scoreboard players remove @s exhaust 0",
										"effect @s weakness 1 20"
									]
								},
								"damage": {
									"type": "entity_attack",
									"amount": 1,
									"target": "other"
								}
							},
							{
								"condition": "query.scoreboard('ignrrmr')==1",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 7,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 5,
											"target": "other"
										}
									},
									{
										"run_command": {
											"command": [
												"scoreboard players set @s ignrrmr 0"
											]
										}
									}
								]
							},
							{
								"condition": "!query.is_riding&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 5,
											"amplifier": 2
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 3,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "!query.is_on_ground&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 10,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 4,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "query.is_riding&&query.scoreboard('mace_cd')<2",
								"damage": {
									"type": "magic",
									"amount": 1,
									"target": "other"
								},
								"add_mob_effect": {
									"effect": "slowness",
									"target": "other",
									"duration": 2,
									"amplifier": 3
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('mdmmstr')>=1000",
						"sequence": [
							{
								"run_command": {
									"command": [
										"scoreboard objectives add mace_cd dummy",
										"tag @s remove hevh",
										"scoreboard players remove @s exhaust 2"
									]
								},
								"damage": {
									"type": "entity_attack",
									"amount": 5,
									"target": "other"
								}
							},
							{
								"condition": "query.scoreboard('ignrrmr')==1",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 7,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 6,
											"target": "other"
										}
									},
									{
										"run_command": {
											"command": [
												"scoreboard players set @s ignrrmr 0"
											]
										}
									}
								]
							},
							{
								"condition": "!query.is_riding&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 5,
											"amplifier": 2
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 5,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "!query.is_on_ground&&query.scoreboard('mace_cd')<2",
								"sequence": [
									{
										"add_mob_effect": {
											"effect": "slowness",
											"target": "other",
											"duration": 10,
											"amplifier": 3
										}
									},
									{
										"damage": {
											"type": "magic",
											"amount": 5,
											"target": "other"
										}
									}
								]
							},
							{
								"condition": "query.is_riding&&query.scoreboard('mace_cd')<2",
								"damage": {
									"type": "magic",
									"amount": 1,
									"target": "other"
								},
								"add_mob_effect": {
									"effect": "slowness",
									"target": "other",
									"duration": 2,
									"amplifier": 2
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('frctnstrk')>0",
						"sequence": [
							{
								"damage": {
									"type": "fire_tick",
									"amount": 3,
									"target": "other"
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('irnlng')!=1&&query.scoreboard('dmndlng')!=1",
						"randomize": [
							{
								"weight": 10,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 0"
									]
								}
							},
							{
								"weight": 20,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust"
									]
								}
							},
							{
								"weight": 5,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 1"
									]
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('irnlng')==1",
						"randomize": [
							{
								"weight": 10,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 1"
									]
								}
							},
							{
								"weight": 20,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 2"
									]
								}
							},
							{
								"weight": 5,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 0"
									]
								}
							}
						]
					},
					{
						"condition": "query.scoreboard('dmndlng')==1",
						"randomize": [
							{
								"weight": 10,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 0"
									]
								}
							},
							{
								"weight": 20,
								"run_command": {
									"command": [
										"scoreboard players remove @s exhaust 1"
									]
								}
							}
						]
					},
					{
						"randomize": [
							{
								"weight": 10,
								"damage": {
									"type": "durability",
									"amount": 1
								}
							},
							{
								"weight": 20,
								"damage": {
									"type": "durability",
									"amount": 0
								}
							},
							{
								"weight": 5,
								"damage": {
									"type": "durability",
									"amount": 2
								}
							}
						]
					},
					{
						"randomize": [
							{
								"weight": 15,
								"run_command": {
									"command": [
										"scoreboard objectives add mdmmstr dummy"
									]
								}
							},
							{
								"weight": 20,
								"run_command": {
									"command": [
										"scoreboard objectives add mdmmstr dummy",
										"scoreboard players add @s mdmmstr 1"
									]
								}
							},
							{
								"weight": 10,
								"run_command": {
									"command": [
										"scoreboard objectives add mdmmstr dummy",
										"scoreboard players add @s mdmmstr 2"
									]
								}
							},
							{
								"weight": 2,
								"run_command": {
									"command": [
										"scoreboard objectives add mdmmstr dummy",
										"scoreboard players add @s mdmmstr 5"
									]
								}
							}
						]
					}
				]
			}
		}
	}
}