{
  "format_version": "1.20.50",
  "minecraft:block": {
    "description": {
      "identifier": "nicothekid:heated_netherrack_active",
      "menu_category": {
				"category": "nature"
			},
			"states": {
        "nicothekid:heated_netherrack_active_lighten": [
          0,
          1
        ]
      }
    },
    "components": {
      "minecraft:material_instances": {
        "*": {
          "texture": "nicothekid_heated_netherrack_active",
          "render_method": "opaque",
          "ambient_occlusion": true,
					"face_dimming": true
        }
      },
      "minecraft:unit_cube": {},
      "minecraft:map_color": "#502A05",
      "minecraft:breathability": "solid",
      "minecraft:light_dampening": 15,
      "minecraft:light_emission": 2,
      "minecraft:friction": 0.4,
      "minecraft:flammable": false,
      "minecraft:destructible_by_explosion": {
        "explosion_resistance": 15.0
      },
      "minecraft:destructible_by_mining": {
				"seconds_to_destroy": 0.4
			},
      "minecraft:loot": "loot_tables/nicos_cave_expansion/blocks/nicothekid_heated_netherrack_active.json",
      "minecraft:random_ticking": {
				"on_tick": {
					"event": "nicothekid:heated_netherrack_random_inactive"
				}
			},
			"minecraft:on_step_on": {
				"condition": "query.has_any_family('mob', 'piglin', 'player') && !query.has_any_family('magma_golem', 'magmacube', 'strider', 'zoglin', 'zombie_pigman')",
				"event": "nicothekid:on_step_on",
				"target": "self"
			},
			"minecraft:on_step_off": {
				"condition": "query.has_any_family('mob', 'piglin', 'player') && !query.has_any_family('magma_golem', 'magmacube', 'strider', 'zoglin', 'zombie_pigman')",
				"event": "nicothekid:on_step_off",
				"target": "self"
			},
      
      "tag:heated_netherrack_active": {},
      "tag:heated_netherrack": {},
      "tag:netherrack": {},
      "tag:stone": {},
      "tag:solid_block": {}
    },
    "permutations": [
      {
        "condition": "query.block_state('nicothekid:heated_netherrack_active_lighten') == 0",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "nicothekid_heated_netherrack_active",
              "render_method": "opaque",
              "ambient_occlusion": true,
              "face_dimming": true
            }
          },
          "minecraft:light_dampening": 15,
          "minecraft:light_emission": 4
        }
      },
      {
        "condition": "query.block_state('nicothekid:heated_netherrack_active_lighten') == 1",
        "components": {
          "minecraft:material_instances": {
            "*": {
              "texture": "nicothekid_heated_netherrack_active_lighten",
              "render_method": "opaque",
              "ambient_occlusion": false,
              "face_dimming": false
            }
          },
          "minecraft:light_dampening": 15,
          "minecraft:light_emission": 9,
          "minecraft:queued_ticking": {
            "looping": false,
            "interval_range": [ 10, 40 ],
            "on_tick": {
              "event": "nicothekid:heated_netherrack_active_explosion",
              "target": "self"
            }
          }
        }
      }
    ],
    "events": {
      "nicothekid:heated_netherrack_random_inactive": {
				"randomize": [
					{
						"weight": 50
					},
					{
						"weight": 100,
						"trigger": {
							"event": "nicothekid:active_heated_netherrack_to_inactive"
						}
					}
				]
      },
      "nicothekid:active_heated_netherrack_to_inactive": {
        "set_block": {
					"block_type": "nicothekid:heated_netherrack"
				}
      },
      "nicothekid:on_step_on": {
				"run_command": {
					"command": [
						"playsound random.fizz @a[r=5]",
						"particle nicothekid:heated_netherrack_active_particle ~ ~ ~"
					]
				},
				"damage": {
					"type": "contact",
					"amount": 1,
					"target": "other"
				},
				"trigger": {
				  "event": "nicothekid:active_heated_netherrack_lighten"
				}
			},
			"nicothekid:active_heated_netherrack_lighten": {
        "set_block_state": {
					"nicothekid:heated_netherrack_active_lighten": 1
				}
      },
			"nicothekid:on_step_off": {
				"set_block_state": {
					"nicothekid:heated_netherrack_active_lighten": 0
				}
			},
			"nicothekid:heated_netherrack_active_explosion": {
				"sequence": [
					{
						"run_command": {
							"command": [
								"summon nicothekid:projectile_heated_netherrack_active_explosion ~ ~ ~ ~ ~"
							]
						}
					},
					{
						"set_block": {
							"block_type": "minecraft:air"
						}
					}
				]
			}
    }
  }
}
