Question How to compute ground-level height in a flat world (1.18.1)

Bletch

New member
Jan 8, 2022
2
0
1
Hi, since the Y coordinate has changed to allow lower and higher building (-64...320), when I now create a flat world, the ground level block is y=-61. Prior to 1.18.1, I used to be able to ASSume that that block would be y=3.

I know that I can now ASSume that the lowest block in the world will be -64, but where can I find that value? I need my code to be able to work with 1.16.5 worlds and 1.18.1 worlds.

I've looked at world.getSeaLevel() which yields 63 (positive), but that seems a bit arbitrary.

I can't use world.getHighestBlockY because I want to know what the ground level block should be and not what it is at that x,y location - i.e. if blocks had been broken.

So can I find this value somewhere?

As background, I work with kids that I teach to manipulate the Minecraft world in Python using my heavily modified version of the MCPI plugin that allows method calling on Blocks, Entities and the World. I'm happy to expose this ground-level value to the Python side via my plugin.

Thanks in advance!