[SPIGOT-7970] WorldInfo.getMaxHeight() returning incorrect value in 1.21.3 Created: 30/Nov/24  Updated: 25/Dec/24  Resolved: 30/Nov/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: jacob1 Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Version: CraftBukkit version 4394-Spigot-60c9969-2b9a094 (MC: 1.21.3) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

WorldInfo.getMaxHeight() acts differently in 1.21.3 compared to before, it's now one less.

In 1.21.1 and older, it returned 320, now it returns 319. Similar thing in the nether, where it used to return 256 but now it says 255. I think this makes sense, but ...

According to the docs, "If the max height is 100, there are only blocks from y=0 to y=99."

The docs say this method is an exclusive max height, not inclusive. If it returns 319, this means that there should be no block at y=319, only y=318.

Very basic test plugin:

int maxHeight = getServer().getWorld("world").getMaxHeight();
System.out.println(maxHeight);

Generated at Tue Apr 08 01:20:50 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.