You can get the collision shape of a block using the BlockState#getCollisionShape method. You can then call the isEmpty method on the result, and if is true it means that the block you get the collision shape from has no collision
The version you are using is no longer supported on this forum.
Please update to a modern version of Minecraft to receive support.
Currently supported versions are 1.19 (Latest) 1.18.2 (LTS) and 1.16.5 (grace period).