But if the player is in x = 158 z = 115 (not multiple of 16) ot will give the correct he correct chunkX and chunkZ where the playzr stand ? And all players in the same chunk will get the same chunkX and ChunkZ with : X >> 4 Z >> 4 ?
>> is a bit shift so it automatically rounds down. It would be slightly faster than a division which may do a float conversion which you then need to cast to int.
Exactly because it is easy, that's why they made it 16 blocks per chunk instead of 20 blocks per chunk. Because you can't achieve the same thing with 20. You'll have to divide by 20 and cast to int in that case.
You didn't fail at all. Any Voxel based game has 16x16x16 render chunks. Don't forget that Minecraft has a build height of 256 blocks so there are also 16 chunks vertically (Render Chunks). See the green part. It's an entire chunk. As you can see it has only X and Z coordinates. But if you see in the Hierarchy the chunk has 16 subitems: they are Render Chunks and they are 16x16x16 in size and they have only the Y coordinate (from 0 to 15)