{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:spawner",
          "conditions": [
            {
              "condition": "minecraft:match_tool",
              "predicate": {
                "enchantments": [
                  {
                    "enchantment": "minecraft:silk_touch"
                  }
                ]
              }
            }
          ]
        }
      ],
      "functions": [
        {
          "function": "minecraft:set_name",
          "entity": "this",
          "name": {
            "nbt": "SpawnData.id",
            "block": "~ ~ ~"
          }
        }
      ]
    }
  ]
}