Some blockstates appear twice in a debug world
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_):
if (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0) { p_177461_0_ = p_177461_0_ / 2; p_177461_1_ = p_177461_1_ / 2; if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT) { int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_); if (i < ALL_VALID_STATES.size()) { iblockstate = ALL_VALID_STATES.get(i); } } }
The west-east grid size is used in a place that should be using the north-south grid size.
int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_);
should be
int i = MathHelper.abs(p_177461_0_ * GRID_HEIGHT + p_177461_1_);
There is an off-by-one: a <= at the southern edge which should be a <.
if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT)
should be
if (p_177461_0_ < GRID_WIDTH && p_177461_1_ < GRID_HEIGHT)
The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. It only causes it to show up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
Linked Issues
is duplicated by6
Created Issue:
End gateway generates 2 times in a debug world
In a Debug world setting, where every block with every states generates, the end gateway appears two times despite not having any states whatsoever that could explain that.
Steps to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look at the blocks at 157 70 165 and 159 70 1. They are most likely invisible, you can tell that they are end gateways if you press F3 and look at the bottom right.
In a Debug world setting, where every block with every states generates, the end gateway appears two times despite not having any states whatsoever that could explain that.
Steps to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look at the blocks at 157 70 165 and 159 70 1. They are most likely invisible, you can tell that they are end gateways if you press F3 and look at the bottom right.
The bug
In a Debug world setting, where every block with every states generates, the end gateway appears two times despite not having any states whatsoever that could explain that.
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look at the blocks at 157 70 165 and 159 70 1. They are most likely invisible, you can tell that they are end gateways if you press F3 and look at the bottom right.
End gateway generates 2 timesin a debug worldSome blockstates appear twice in a debug world.
Some blockstates appear twice in a debug world.
The bug
In a Debug world setting, where every block with every states generates
, the end gateway appears two times despite not having any states whatsoever that could explain that.How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look at the blocks at
15770 165 and15970 1.They are most likely invisible, you can tell that they are end gateways if you pressF3 and look at the bottom right.The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should do it. There is a <= at the southern edge which should be a <, the west-east grid size is used where it should be the north-south grid size. The bug only shows up when those two sizes are unequal.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should
doit. There is a <= at the southern edge which should be a <, the west-east grid size is usedwhere it should be the north-south grid size.The bug only shows up when those two sizes are unequal.The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should address it. There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this error visible. It only shows up when those two sizes are unequal, like in these snapshots and in 1.10.2 for example, and not in 1.11.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should address it. There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this error visible, otherwise it would just change the grid size slightly and no-one would care or notice. It only shows up when those two sizes are unequal, like in these snapshots and in 1.10.2 for example, and not in 1.11.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should address it. There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this
errorvisible, otherwise it wouldjustchange thegrid sizeslightlyand no-one would care or notice.It only shows up when those two sizes are unequal, like in these snapshotsand in1.10.2 for example, and not in 1.11.2 for example.The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e should address it. There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change: http://www.diff-online.com/view/5a22434cea26e
should address it.There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change should address it:
if (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0)
{
p_177461_0_ = p_177461_0_ / 2;
p_177461_1_ = p_177461_1_ / 2;if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT)
{
int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_);if (i < ALL_VALID_STATES.size())
{ iblockstate = ALL_VALID_STATES.get(i); }}
}There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change should address it:
if (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0)
{
p_177461_0_ = p_177461_0_ / 2;
p_177461_1_ = p_177461_1_ / 2;if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT)
{
int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_);if (i < ALL_VALID_STATES.size())
{ iblockstate = ALL_VALID_STATES.get(i); }}
}There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change should address it:
ChunkGeneratorDebug.javaif (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0) { p_177461_0_ = p_177461_0_ / 2; p_177461_1_ = p_177461_1_ / 2; if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT) { int i = MathHelper.abs(p_177461_0_ * GRID_{color:red}WIDTH{color}{color:green}HEIGHT{color} + p_177461_1_); if (i < ALL_VALID_STATES.size()) { iblockstate = ALL_VALID_STATES.get(i); } } }There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_), the following change should address it:
ChunkGeneratorDebug.javaif (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0) { p_177461_0_ = p_177461_0_ / 2; p_177461_1_ = p_177461_1_ / 2; if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT) { int i = MathHelper.abs(p_177461_0_ * GRID_{color:red}WIDTH{color}{color:green}HEIGHT{color}+ p_177461_1_); if (i < ALL_VALID_STATES.size()) { iblockstate = ALL_VALID_STATES.get(i); } } }There is an off-by-one: a <= at the southern edge which should be a <. Also, the west-east grid size is used in a place that should be using the north-south grid size. The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. And it only shows up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
The bug
In a Debug world setting, where every block with every states generates. However, all blocks will appear a second time with the exact same states, if they are happen to generate ar the end of the z-axis (z=165). They will then appear again at the beginning of the next row (x-coordinate + 2, z=1).
How to reproduce
- When creating a new world, go to more world options click the world type button holding shift until it says "Debug Mode" to create a debug world
- Now look for example at the blocks at 3 70 165 and 5 70 1. Press F3 to displaay the state at the bottom right. In that case both blocks will be minecraft:dispenser[facing=west,triggered=false]
Code analysis
In (MCP 9.40 naming) the function net.minecraft.world.gen.ChunkGeneratorDebug.getBlockStateFor(int p_177461_0_, int p_177461_1_):
ChunkGeneratorDebug.javaif (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0) { p_177461_0_ = p_177461_0_ / 2; p_177461_1_ = p_177461_1_ / 2; if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT) { int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_); if (i < ALL_VALID_STATES.size()) { iblockstate = ALL_VALID_STATES.get(i); } } }The west-east grid size is used in a place that should be using the north-south grid size.
int i = MathHelper.abs(p_177461_0_ * GRID_WIDTH + p_177461_1_);
should be
int i = MathHelper.abs(p_177461_0_ * GRID_HEIGHT + p_177461_1_);There is an off-by-one: a <= at the southern edge which should be a <.
if (p_177461_0_ <= GRID_WIDTH && p_177461_1_ <= GRID_HEIGHT)
should be
if (p_177461_0_ < GRID_WIDTH && p_177461_1_ < GRID_HEIGHT)The off-by-one is what makes this bug visible; without it, you just have a slightly wrong grid size, and no-one would care or notice. It only causes it to show up when the two switched sizes are unequal, like in these snapshots or 1.10.2 for example, and not in 1.11.2 or 1.12.2 for example.
Confirmed for 18w03b
is duplicated by
is duplicated by
is duplicated by
is duplicated by
relates to
is duplicated by
is duplicated by
@[Mojang] Adrian Östergård Why was this bug tagged as won't fix? Just do what is shown in “Code analysis” will fix it. And it really confusing and doesn't make any sense to make some blockstates appear twice in Debug world.
Sorry, this bug is a duplicate of, uh... i forgot. Let me check.
EDIT: Its a duplicate of MC-122412.
Thank you for your report!
We're tracking this issue in MC-122412, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! Please report any issues in Discord or Reddit
Thank you for your report!
We're tracking this issue in MC-122412, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Thank you for your report!
We're tracking this issue in MC-122412, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki


this is only a guess but maybe one's the 'Entrance' and the others the 'Exit', as you yourself can make custom end gateways. another possibility is that there's a technical state for them that we the players cannot access and is purely for the game.
end_gateway and end_portal?
No, it's two end gateways, I checked.
So I guess reopen it?
Actually, looking at it again, it seems like all blockstates at the end of a Z-axis-row (z=165) appear again at the next higher x-coordinate at Z=1.
The erroneous code is still present in 18w07a, even though the conditions aren't present for the effects to manifest in vanilla. Marking as affects 18w07a.
Can confirm for 1.13.
In the current snapshot, the bug is reproducable without looking at code again.
Affects 19w09a
The same code problem exists in 1.15-pre6, although conditions are not favorable to actually reproduce (by my calculations, with the current 11337 states, GRID_WIDTH is 107 and GRID_HEIGHT is 106, which I think hides the actual problem. But I'm not 100% sure)
Affects 20w13b in-game without having to look at the code.
Can confirm in 21w16a.
Dl, just to let you know, the bug tracker is not a discussion forum. If you'd like to talk about the outcome of a bug, please do so on either the Mojira Discord or Mojira Reddit.