{
  "format_version": "1.8.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:tnt_minecart",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },

    "component_groups": {
      "minecraft:primed_tnt": {
        "minecraft:explode": {
          "on_activate": {

          },
          "fuseLength": 4,
          "fuseLit": true,
          "power": 3,
          "causesFire": false
        },
        "minecraft:rail_sensor": {
          
        
        },
        "minecraft:is_ignited": {
        }
      },
      "minecraft:instant_explode_tnt": {
        "minecraft:explode": {
          "on_activate": {

          },
          "fuseLength": 0,
          "fuseLit": true,
          "power": 3,
          "causesFire": false
        },
        "minecraft:rail_sensor": {
          
        
        },
        "minecraft:is_ignited": {
        }
      },
      "minecraft:inactive": {
        "minecraft:rail_sensor": {
          "on_activate": {

            "filters": {
              "all_of": [
                {
                  "test": "is_game_rule",
                  "domain": "tntexplodes",
                  "operator": "==",
                  "value": true
                }
              ]
            },
            "event": "minecraft:on_prime"
          }
          
        },
        "minecraft:interact": [
          {
            "on_interact": {
            "filters": {
			  "any_of": [
				{"test": "has_equipment", "subject": "other", "domain": "hand", "value": "fireball:0"},
          {
            "test": "has_equipment",
            "subject": "other",
            "domain": "hand",
            "value": "flint_and_steel"
          }
			  ],
			  "all_of": [
          {"test": "is_family", "subject": "other", "value": "player"},
          {"test": "is_game_rule", "domain": "tntexplodes", "operator": "==", "value": true}
			  ]
			},
              "event": "minecraft:on_prime",
              "target": "self"
            },
            "swing": true,
            "play_sounds": "ignite",
            "interact_text": "action.interact.creeper"
          },
          {
            "on_interact": {
              "filters": {
                "any_of": [
                  {
                    "test": "has_component",
                    "subject": "other",
                    "value": "fire_aspect"
                  }
                ],

                "all_of": [
                  {
                    "test": "is_game_rule",
                    "domain": "tntexplodes",
                    "operator": "==",
                    "value": true
                  }
                ]

              },
              "event": "minecraft:on_prime",
              "target": "self"
            },
            "swing": true,
            "interact_text": "action.interact.creeper"
          }
        ]
      }
    },

    "components": {
      "minecraft:type_family": {
        "family": [ "minecart", "inanimate" ]
      },
      "minecraft:collision_box": {
        "width": 0.98,
        "height": 0.7
      },
      "minecraft:rail_movement": {
      },
      "minecraft:is_stackable": {
      },
	    "minecraft:physics": {
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "minecraft:inactive"
          ]
        }
      },
      "minecraft:on_prime": {
        "remove": {
          "component_groups": [
            "minecraft:inactive"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:primed_tnt"
          ]
        }
      },
      "minecraft:on_instant_prime": {
        "remove": {
          "component_groups": [
            "minecraft:inactive"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:instant_explode_tnt"
          ]
        }
      }
    }

  }
}
