{
	"type": "origins:multiple",
	"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"
	},
	"speed":
	{
		"type": "origins:attribute",
		"modifier": {
			"attribute": "minecraft:generic.movement_speed",
			"operation": "multiply_total",
			"value": -1
		}
	},
	"motion":
	{
		"type": "origins:action_over_time",
		"interval": 10,
		"entity_action":{
			"type": "origins:if_else_list",
			"actions":[
				{
					"condition":{
						"type": "origins:resource",
						"comparison": "==",
						"resource": "*:*_idiot_detected",
						"compare_to": 0
					},
					"action":{
						"type": "origins:area_of_effect",
						"radius": 16,
						"bientity_action":{
							"type": "origins:actor_action",
							"action":{
								"type": "origins:and",
								"actions":[
									{
										"type": "origins:change_resource",
										"resource": "*:*_idiot_detected",
										"change": 5
									},
									{
										"type": "origins:execute_command",
										"command": "playsound minecraft:block.note_block.bit master @a ~ ~ ~ 1.6 2"
									},
									{
										"type": "origins:delay",
										"ticks": 2,
										"action": {
											"type": "origins:execute_command",
											"command": "playsound minecraft:block.note_block.bit master @a ~ ~ ~ 1.6 1"
										}
									}
								]
							}
						},
						"bientity_condition":{
							"type": "origins:and",
							"conditions":[
								{
									"type": "origins:can_see"
								},
								{
									"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
															}
														]
													}
												]
											}
										]
									}
								}
							]
						}
					}
				},
				{
					"condition":{
						"type": "origins:resource",
						"comparison": ">",
						"resource": "*:*_idiot_detected",
						"compare_to": 0
					},
					"action":{
						"type": "origins:and",
						"actions": [
							{
								"type": "origins:execute_command",
								"command": "playsound minecraft:entity.firework_rocket.blast master @a ~ ~ ~ 1.5 1.5"
							},
							{
								"type": "origins:execute_command",
								"command": "tp @s ^ ^ ^ facing entity @e[type=!minecraft:item,type=!minecraft:item_frame,type=!minecraft:glow_item_frame,type=!minecraft:armor_stand,type=!minecraft:marker,type=!minecraft:area_effect_cloud,tag=!turret,tag=!turretm,limit=1,sort=nearest,distance=..16] feet"
							},
							{
								"type": "origins:raycast",
								"distance": 16,
								"block": true,
								"entity": true,
								"shape_type": "visual",
								"fluid_handling": "any",
								"bientity_action": {
									"type": "origins:target_action",
									"action": {
										"type": "origins:if_else_list",
										"actions": [
											{
												"condition": {
													"type": "origins:and",
													"conditions": [
														{
															"type": "origins:enchantment",
															"enchantment": "minecraft:protection",
															"calculation": "sum",
															"comparison": "<",
															"compare_to": 8
														}
													]
												},
												"action": {
													"type": "origins:damage",
													"amount": 2,
													"source": {
														"name": "fireworks",
														"bypasses_armor": true
													}
												}
											},
											{
												"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": 4,
													"source": {
														"name": "fireworks",
														"bypasses_armor": true
													}
												}
											},
											{
												"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": 7,
													"source": {
														"name": "fireworks",
														"bypasses_armor": true
													}
												}
											},
											{
												"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": 14,
													"source": {
														"name": "fireworks",
														"bypasses_armor": true
													}
												}
											},
											{
												"condition": {
													"type": "origins:or",
													"conditions": [
														{
															"type": "origins:enchantment",
															"enchantment": "minecraft:protection",
															"calculation": "sum",
															"comparison": ">=",
															"compare_to": 20
														}
													]
												},
												"action": {
													"type": "origins:damage",
													"amount": 20,
													"source": {
														"name": "fireworks",
														"bypasses_armor": true
													}
												}
											}
										]
									}
								},
								"bientity_condition": {
									"type": "origins:and",
									"conditions":
									[
										{
											"type": "origins:can_see"
										},
										{
											"type": "origins:target_condition",
											"condition": {
												"type": "origins:or",
												"conditions":
												[
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:item",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:armor_stand",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:item_frame",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:glow_item_frame",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:item_display",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:marker",
														"inverted": true
													},
													{
														"type": "origins:entity_type",
														"entity_type": "minecraft:area_effect_cloud",
														"inverted": true
													}
												]
											}
										},
										{
											"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
																	}
																]
															}
														]
													}
												]
											}
										}
									]
								},
								"command_at_hit": "particle minecraft:scrape",
								"command_along_ray": "particle minecraft:smoke",
								"command_step": 1,
								"command_along_ray_only_on_hit": false
							},
							{
								"type": "origins:change_resource",
								"resource": "*:*_idiot_detected",
								"change": -1
							}
						]
					}
				}
			]
		}
	},
	"idiot_detected": 
	{
		"type": "origins:resource",
		"min": 0,
		"max": 5,
		"start_value": 0,
		"hud_render": {
			"should_render": false
		}
	},
	"death": 
	{
		"type": "origins:resource",
		"min": 0,
		"max": 60,
		"start_value": 60,
		"hud_render": {
			"should_render": false
		},
		"min_action":{
			"type": "origins:and",
			"actions": [
				{
					"type": "origins:execute_command",
					"command": "playsound minecraft:entity.generic.explode master @a ~ ~ ~ 0.3 0.6"
				},
				{
					"type": "origins:execute_command",
					"command": "execute at @s run particle minecraft:explosion ^ ^ ^ 0.3 0 0.3 0 20 normal @a"
				},
				{
					"type": "origins:execute_command",
					"command": "tp @s ~ ~-300 ~"
				},
				{
					"type": "origins:execute_command",
					"command": "kill @s"
				}
			]
		}
	},
	"timer": 
	{
		"type": "origins:action_over_time",
		"interval": 20,
		"entity_action": {
			"type": "origins:if_else_list",
			"actions": [
				{
					"condition": {
						"type": "origins:resource",
						"comparison": ">",
						"resource": "*:*_death",
						"compare_to": 0
					},
					"action":{
						"type": "origins:change_resource",
						"resource": "*:*_death",
						"change": -1
					}
				}
			]
		}
	}
}