Buggy DefaultState?

I know, that i can get the block’s variant by using the DefaultState() method.
Problem is, that (for example)

  • every stone_slab (brick, stone, sandstone, …) has the same variant (stone)
  • every wooden_planks block (oak, jungle, …) has the same variant (oak)
    .
    .
    .

So I don’t know, what I schould do now, to seperate theese blocks / get their sub-id.

Used code (ChangeBlock.Break event):
event.getTransactions().get(0).getOriginal().getState().getType().getDefaultState().toString()

Thanks

Just replace .getType().getDefaultState() with .getState().

That’s because a default state doesn’t hold block metadata. When you’re using getDefaultState(), you’re asking for a fresh copy of the default state, with nothing else applied to it. You can just call use getState() off of getOriginal() and do what you wish with that.