{
	"type": "origins:multiple",
	"self_destruct":
	{
		"type": "origins:resource",
		"min": 0,
		"max": 1,
		"start_value": 1,
		"hud_render": {
			"should_render": true
		}
	},
	"resistances": 
	{
		"type":"origins:modify_damage_taken",
		"modifier":{
			"value": -0.5,
			"operation":"multiply_total"
		}
	},
	"sacrifice":
	{
		"type": "origins:prevent_death",
		"entity_action": {
			"type": "origins:and",
			"actions": [
				{
					"type": "origins:change_resource",
					"resource": "*:*_self_destruct",
					"change": -1
				},
				{
					"type": "origins:and",
					"actions": [
						{
							"type": "origins:execute_command",
							"command": "playsound minecraft:entity.firework_rocket.twinkle_far master @a ~ ~ ~ 4 1"
						},
						{
							"type": "origins:execute_command",
							"command": "playsound minecraft:entity.lightning_bolt.impact master @a ~ ~ ~ 4 1"
						},
						{
							"type": "origins:execute_command",
							"command": "execute at @s run particle minecraft:flash ^ ^ ^ 0 0 0 0 1 normal @a"
						},
						{
							"type": "origins:execute_command",
							"command": "execute at @s run particle minecraft:explosion ^ ^ ^ 4 0 4 0 50 normal @a"
						},
						{
							"type": "origins:area_of_effect",
							"radius": 10,
							"bientity_action": {
								"type": "origins:target_action",
								"action": {
									"type": "origins:and",
									"actions": [
										{
											"type": "origins:add_velocity",
											"z": 0.25
										},
										{
											"type": "origins:add_velocity",
											"y": 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": 81,
														"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": 90,
														"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": 98,
														"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": 106,
														"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": 140,
														"source": {
															"name": "explosion",
															"bypasses_armor": true,
															"unblockable": false
														}
													}
												}
											]
										}
									]
								}
							},
							"bientity_condition": {
								"type": "origins:and",
								"conditions":
								[
									{
										"type": "origins:can_see"
									},
									{
										"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": "damage @s 64 minecraft:explosion"
						},
						{
							"type": "origins:execute_command",
							"command": "kill @s"
						}
					]
				}
			]
		},
		"condition":{
			"type": "origins:resource",
			"comparison": "==",
			"resource": "*:*_self_destruct",
			"compare_to": 1
		}
	}
}