Minecraft: Using block states within datapack tags

I have a datapack which uses a stonecutter to automatically break whatever block is above it, however currently it is always on, meaning the only way to stop it is to break the actual block.

Having recently (by which I mean the night before I'm writing this) learned about how to use the tags folder, I assumed I could create a list of items as follows;

{
  "values": [
    "minecraft:redstone_torch[lit=true]",
    "minecraft:lever[powered=true]",
    "minecraft:redstone_block"
  ]
}

Which I would then use as execute as @e[tag=grindcutter] at @s if block ~ ~-1 ~ #powered run tag @s add powered

However, the # filter didn't appear in game. After comparing the file with another working filter, I experimentally removed the block states from the lever and torch, which made the filter appear in game. Now, the whole reason I wanted this was so that I could place a lever under the stone cutter, then when I wanted to deactivate the auto break I could just power the lever.

I know I could use something like execute as @e[tag=grindcutter] at @s if block ~ ~-1 ~ lever[powered=true] run tag @s add powered, but then if I wanted to automate the process in game, I would have to add near duplicates of that exact code for every edge case, then if in the future I wanted to add or remove more options, I would need to change the actual code itself instead of word line in a tags file.

When I looked on the Minecraft wiki, all it had to say was;

Block tags Block tags can be called when testing for block arguments in commands with #(resource location), which succeeds if the block matches any of the blocks specified in the tag.

When I looked to see if anyone else had experienced the same issue, I saw a reddit post, which suggested the feature got removed from the game.

Maybe I am missing something and there is an easy way to specify block states within a datapack tag, or I just have to stomach my personal distaste and use multiple duplicate lines of code. Regardless, any help will be appreciated!


Answering this for anyone else who came across the same problem.

While you cannot use block states within the datapack, you can use them on the filter. Meaning, inside the tags json file it would look like this;

{
  "values": [
    "minecraft:redstone_torch",
    "minecraft:lever",
    "minecraft:redstone_block"
  ]
}

Then within the command you'd use the block state on the filter, so you'd use execute if block ~ ~-1 ~ #powered[lit=true] run tag @s add powered for redstone this is less useful since some of the block states are different, but for waterlogged blocks, it is far more useful.