[Solved]How to get the nbt

I want to get a “root” nbt tag from a mod tile entity.
Implement the VariantData ?

TileEntity tileEntity = blockSnapshot.getLocation().get().getTileEntity().get();
if(tileEntity.isValid()){
    data = tileEntity.get("xxxx")  // How to "get"?
}

Solved: We should use the entity.toContainer() to get the data.

What’re you trying to do with the raw data?

Get a root tag of a mod block