{
	"type": "origins:multiple",
	"callback":
	{
		"type": "origins:action_on_callback",
		"entity_action_added": {
			"type": "origins:and",
			"actions": [
				{
					"type": "origins:execute_command",
					"command": "scale delay set 0 @s"
				},
				{
					"type": "origins:execute_command",
					"command": "scale set pehkui:height 0.4 @s"
				},
				{
					"type": "origins:execute_command",
					"command": "scale set pehkui:width 0.4 @s"
				},
				{
					"type": "origins:execute_command",
					"command": "tp @s ^ ^ ^ facing entity @e[tag=ordtarget,limit=1,sort=nearest,distance=..15] feet"
				}
			]
		}
	},
	"model":
	{
		"type": "origins:model_color",
		"red": 0.1,
		"green": 0.1,
		"blue": 0.1
	},
	"basehealth": 
	{
		"type": "origins:attribute",
		"update_health": true,
		"modifiers": {
			"attribute": "minecraft:generic.max_health",
			"operation": "multiply_total",
			"value": -0.5
		}
	},
	"immunities": 
	{
		"type":"origins:modify_damage_taken",
		"modifier":{
			"value": -1,
			"operation":"multiply_total"
		},
		"damage_condition":	{
			"type": "origins:name",
			"name": "explosion"
		}
	},
	"no_collision": 
	{
		"type": "origins:prevent_entity_collision"
	},
	"motion":
	{
		"type": "origins:action_over_time",
		"interval": 2,
		"entity_action": {
			"type": "origins:and",
			"actions": [
				{
					"type": "origins:execute_command",
					"command": "playsound minecraft:block.note_block.bit master @a ~ ~ ~ 0.15 2"
				},
				{
					"type": "origins:execute_command",
					"command": "tp @s ^ ^ ^ facing entity @e[tag=ordtarget,limit=1,sort=nearest,distance=..20] feet"
				},
				{
					"type": "origins:add_velocity",
					"z": 0.4,
					"space": "local"
				},
				{
					"type": "origins:execute_command",
					"command": "execute at @s run particle minecraft:campfire_cosy_smoke ^ ^ ^-0.5 0 0 0 0 1 normal @a"
				}
			]
		}
	},
	"antigrav":
	{
		"type": "origins:modify_falling",
		"velocity": 0.01,
		"take_fall_damage": false
	},
	"untimely_detonation":
	{
		"type": "origins:action_over_time",
		"interval": 2,
		"entity_action": {
			"type": "origins:if_else_list",
			"actions": [
				{
					"condition": {
						"type": "origins:block_collision",
						"offset_x": 0.1,
						"offset_y": 0.1,
						"offset_z": 0.1
					},
					"action": {
						"type": "origins:and",
						"actions": [
							{
								"type": "origins:execute_command",
								"command": "resource set @s ordnance:weapons/weaponry_swarmissile_death 0"
							}
						]
					}
				},
				{
					"condition": {
						"type": "origins:block_collision",
						"offset_x": 0.1,
						"offset_y": 0.1,
						"offset_z": 0.1,
						"inverted": true
					},
					"action": {
						"type": "origins:area_of_effect",
						"radius": 1,
						"bientity_action": {
							"type": "origins:actor_action",
							"action": {
								"type": "origins:execute_command",
								"command": "resource set @s ordnance:weapons/weaponry_swarmissile_death 0"
							}
						},
						"bientity_condition": {
							"type": "origins:target_condition",
							"condition": {
								"type": "origins:or",
								"conditions":
								[
									{
										"type": "origins:nbt",
										"nbt": "{Tags: ['ordtarget']}"
									},
									{
										"type": "origins:resource",
										"comparison": ">",
										"resource": "ordnance:invisible_ordnance_targeted",
										"compare_to": 0
									}
								]
							}
						}
					}
				}
			]
		}
	},
	"death": 
	{
		"type": "origins:resource",
		"min": 0,
		"max": 3,
		"start_value": 3,
		"hud_render": {
			"should_render": false
		},
		"min_action":{
			"type": "origins:if_else_list",
			"actions":[
				{
					"condition":{
						"type": "origins:health",
						"comparison": ">",
						"compare_to": 0
					},
					"action":{
						"type": "origins:and",
						"actions": [
							{
								"type": "origins:execute_command",
								"command": "playsound minecraft:entity.generic.explode master @a ~ ~ ~ 1 1"
							},
							{
								"type": "origins:area_of_effect",
								"radius": 2,
								"bientity_action": {
									"type": "origins:target_action",
									"action": {
										"type": "origins:and",
										"actions": [
											{
												"type": "origins:add_velocity",
												"z": 0.1
											},
											{
												"type": "origins:add_velocity",
												"y": 0.2
											},
											{
												"type": "origins:if_else_list",
												"actions": [
													{
														"condition": {
															"type": "origins:enchantment",
															"enchantment": "minecraft:protection",
															"calculation": "sum",
															"comparison": "<",
															"compare_to": 8
														},
														"action": {
															"type": "origins:damage",
															"amount": 5,
															"source": {
																"name": "explosion",
																"bypasses_armor": false,
																"unblockable": false
															}
														}
													},
													{
														"condition": {
															"type": "origins:and",
															"conditions": [
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": ">=",
																	"compare_to": 8
																},
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": "<",
																	"compare_to": 12
																}
															]
														},
														"action": {
															"type": "origins:damage",
															"amount": 7,
															"source": {
																"name": "explosion",
																"bypasses_armor": false,
																"unblockable": false
															}
														}
													},
													{
														"condition": {
															"type": "origins:and",
															"conditions": [
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": ">=",
																	"compare_to": 12
																},
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": "<",
																	"compare_to": 16
																}
															]
														},
														"action": {
															"type": "origins:damage",
															"amount": 9,
															"source": {
																"name": "explosion",
																"bypasses_armor": false,
																"unblockable": false
															}
														}
													},
													{
														"condition": {
															"type": "origins:and",
															"conditions": [
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": ">=",
																	"compare_to": 16
																},
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": "<",
																	"compare_to": 20
																}
															]
														},
														"action": {
															"type": "origins:damage",
															"amount": 11,
															"source": {
																"name": "explosion",
																"bypasses_armor": true,
																"unblockable": false
															}
														}
													},
													{
														"condition": {
															"type": "origins:or",
															"conditions": [
																{
																	"type": "origins:enchantment",
																	"enchantment": "minecraft:protection",
																	"calculation": "sum",
																	"comparison": ">=",
																	"compare_to": 20
																}
															]
														},
														"action": {
															"type": "origins:damage",
															"amount": 16,
															"source": {
																"name": "explosion",
																"bypasses_armor": true,
																"unblockable": false
															}
														}
													}
												]
											}
										]
									}
								},
								"bientity_condition": {
									"type": "origins:and",
									"conditions":
									[
										{
											"type": "origins:can_see"
										},
										{
											"type": "origins:target_condition",
											"condition": {
												"type": "origins:and",
												"conditions":
												[
													{
														"type": "origins:power",
														"power": "ordnance:weapons/weaponry_mine",
														"inverted": true
													},
													{
														"type": "origins:power",
														"power": "ordnance:weapons/weaponry_missile",
														"inverted": true
													},
													{
														"type": "origins:power",
														"power": "ordnance:weapons/weaponry_swarmissile",
														"inverted": true
													},
													{
														"type": "origins:power",
														"power": "ordnance:weapons/weaponry_transport",
														"inverted": true
													},
													{
														"type": "origins:power",
														"power": "ordnance:weapons/weaponry_bomb",
														"inverted": true
													}
												]
											}
										},
										{
											"type": "origins:or",
											"conditions":
											[
												{
													"type": "origins:target_condition",
													"condition": {
														"type": "origins:entity_type",
														"entity_type": "minecraft:item"
													}
												},
												{
													"type": "origins:both",
													"condition": {
														"type": "origins:or",
														"conditions":
														[
															{
																"type": "origins:and",
																"conditions":
																[
																	{
																		"type": "origins:living"
																	},
																	{
																		"type": "origins:resource",
																		"comparison": "==",
																		"resource": "othersider:invisible_otherside_otherside",
																		"compare_to": 1
																	},
																	{
																		"type": "origins:power",
																		"power": "othersider:invisible_otherside_otherside"
																	}
																]
															},
															{
																"type": "origins:and",
																"conditions":
																[
																	{
																		"type": "origins:living"
																	},
																	{
																		"type": "origins:or",
																		"conditions":
																		[
																			{
																				"type": "origins:resource",
																				"comparison": "==",
																				"resource": "othersider:invisible_otherside_otherside",
																				"compare_to": 0
																			},
																			{
																				"type": "origins:power",
																				"power": "othersider:invisible_otherside_otherside",
																				"inverted": true
																			}
																		]
																	}
																]
															}
														]
													}
												}
											]
										}
									]
								}
							},
							{
								"type": "origins:execute_command",
								"command": "execute at @s run particle minecraft:explosion ^ ^ ^ 0.5 0 0.5 0 10 normal @a"
							},
							{
								"type": "origins:execute_command",
								"command": "tp @s ~ ~-300 ~"
							},
							{
								"type": "origins:execute_command",
								"command": "kill @s"
							}
						]
					}
				}
			]
		}
	},
	"timer": 
	{
		"type": "origins:action_over_time",
		"interval": 10,
		"entity_action": {
			"type": "origins:if_else_list",
			"actions": [
				{
					"condition": {
						"type": "origins:and",
						"conditions": [
							{
								"type": "origins:resource",
								"comparison": ">",
								"resource": "*:*_death",
								"compare_to": 0
							}
						]
					},
					"action": {
						"type": "origins:and",
						"actions": [
							{
								"type": "origins:execute_command",
								"command": "resource change @s ordnance:weapons/weaponry_swarmissile_death -1"
							}
						]
					}
				}
			]
		}
	}
}