Based on code from 1.6.4 the game makes 10 attempts at placing a group of up to 10 cactus per chunk of desert, with each group within a 15x15 block volume 7 blocks high and each individual cactus being between 1-3 blocks tall. This means that each group can generate a cactus up to 9 blocks tall (the upper 2 blocks can extend above the volume chosen for the initial block) and 10 can generate a 90 block tall cactus, which would require that 3 attempts at a 3 block tall cactus align per group and each group is 9 blocks above the previous.
Also, attempts from up to 4 adjacent populated regions can also overlap for up to 4 times this height, or up to the world height limit if the generator chooses random locations that high (in 1.6.4 it chooses a y-coordinate between 0-127 with the full range of individual attempts being -3 to 130 but I know that in 1.7 they extended the range to allow for terrain going higher than y=127). This is due to the chunk populator centering features within a 16x16 block area but since the groups are 15x15 blocks they can extend 7 blocks outside of this area; this is also why you may have seen strange things like trees floating over lakes, despite the fact that lakes are placed before trees, same for tall grass and sand.
The chances of this actually happening are extremely low though, and certainly impossible; given a range of 128 layers (in 1.6.4) the chance of choosing the correct layer 10 times in a row is only 1 in 1.18 x 10^21, which is already far beyond the number of states the RNG used has (2.81 x 10^14); even a full 64 bit RNG only has 1.84 x 10^19 states.
For perspective, I modified the cactus generation code to keep track of the tallest cactus found after it placed a cactus and had to fly 4000 blocks before I found one that was 5 blocks tall in a Superflat world with the "Desert" preset (there may have been other 4 block tall cactus but I only kept track of the tallest one), with 6768 chunks generated (if not all populated; flying straight will generate a 21 chunk wide swath with 20 of those chunks populated):
[14:52:56] Found 3 block tall cactus at -136 66 194
[14:55:11] Found 4 block tall cactus at 1217 67 1267
[14:59:46] Found 5 block tall cactus at 3917 68 1322
public class WorldGenCactus extends WorldGenerator
private static int maxHeight;
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
for (int var6 = 0; var6 < 10; ++var6)
int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
if (par1World.isAirBlock(var7, var8, var9))
int var10 = 1 + par2Random.nextInt(par2Random.nextInt(3) + 1);
for (int var11 = 0; var11 < var10; ++var11)
if (Block.cactus.canBlockStay(par1World, var7, var8 + var11, var9))
par1World.setBlock(var7, var8 + var11, var9, Block.cactus.blockID, 0, 2);
// Counts the number of cactus blocks and keeps track of the tallest cactus
int count = 0;
var8 += var10 - 1;
for (int y = var8; y > 0; --y)
if (par1World.getBlockId(var7, y, var9) == Block.cactus.blockID)
if (count > maxHeight)
System.out.println("Found " + count + " block tall cactus at " + var7 + " " + var8 + " " + var9);
maxHeight = count;
I also found three 5 block tall cacti in one of my worlds (modded but only caves were changed, which could still affect the placement of decorations), which suggests they may be more common than I found above (either way, the sample size is too small to get an accurate measure of their frequency):
I found this one while playing on the world while the other two were found using MCEdit to look around:
A rendering of the world, which is 13319 chunks:
I presume they did something similar to find a 12 block tall cactus (they only seem to have checked the chunk at 0,0 or even exactly 0,0, which would require a lot of random seeds to even get a desert at that location, while my method can be used anywhere, ideally using a program like Minecraft Land Generator to automatically generate a world).
Do you know if there is any program that finds the tallest cactus from all minecraft seeds and all locations?
Maybe this thread will become the "tallest cactus hunt".
There is no easy way to do this, as opposed to using a tool like AMIDST - you have to actually generate everything, meaning you are more or less limited to using the actual game to generate worlds; likewise, while I've written my own programs to search for the largest and densest cave systems as well as generate underground maps you can easily simulate the data as the cave generator works with a simple array where 0s are air and anything else can be treated as "ground" (I reversed them in the code shown here to make it a simple matter of summing up the values of each array index to count air blocks):
// Modified so layers 11-62 (lava level to sea level) are 0-51 and air is 1 and ground is 0
caveGenerator.generate(centerX + x, centerZ + z);
// Counts the number of air blocks (1s) in chunk data
int volume = 0;
for (int i = 0; i < 13312; ++i)
volume += chunkData[i];
chunkData[i] = 0;
// Stores the volume for each chunk
caveData[x + zIndex] = (short)volume;
This is also why search tools generally do not try to find anything that requires them to be actually generated; when AMIDST locates structures it calls a simple algorithm which uses the chunk coordinates to determine if they can generate, which can't be used to determine the potential locations of cactus because all decorations are placed using a single RNG whose sequence is modified by previously placed decorations extracting values from its sequence (a good way to see this is to use the Customized world type in 1.12.2 and change the size of dirt, even by just 1, which will change the locations of other ores as well as trees, flowers, cactus, etc since the RNG state will now be different when they are generated):
This is the method I calculate if a stronghold can generate in TMCW, it uses the chunk coordinates to set the RNG to a state which is the same across 64x64 chunk regions, so only one chunk within each region will match the chunk coordinates modulo 64, with a relative offset of 0-31 (i.e. one chunk within 0-31 relative to each region will have a stronghold), and allowing only half of regions to have a stronghold in a checkerboard pattern; vanilla uses a similar method to place most structures (I also add seed-specific offsets to the coordinates so they aren't always aligned to multiples of the region size; for example, in vanilla villages generate within 32x32 chunk regions with a relative offset of 0-23, which will only ever generate at 0-23 plus a multiple of 32 as a result):
public boolean validStrongholdLocation(int chunkX, int chunkZ, int distance)
// Generates an infinite number of strongholds starting 40 chunks (640 blocks) from the origin,
// the same minimum distance used by vanilla; strongholds generate to a 128 chunk grid in
// alternating 64x64 chunk regions with a relative offset of 0-31 chunks, for one stronghold
// every 8192 chunks. The same algorithm is used for colossal and regional caves with different
// offsets so they can never collide. Maximum observed distance of the closest stronghold to the
// origin was 1856 blocks.
chunkX += this.strongholdOffsetX;
chunkZ += this.strongholdOffsetZ;
if ((chunkX & 64) != (chunkZ & 64)) return false;
this.spawnRNG.setChunkSeed(chunkX >> 6, chunkZ >> 6);
return (chunkX & 63) == this.spawnRNG.nextInt(32) && (chunkZ & 63) == this.spawnRNG.nextInt(32) && distance >= 1600;
You can easily call a method like this to determine the locations of structures without having to generate a world by calling it within loops that iterate across the search area (with a bit more work you can generate them as mentioned above, where air is 0 and anything else is 1 sot they can be mapped out but it would take a lot to fully simulate actual blocks and everything that is needed to generate to simulate decorations):
This is from a simulation, not from using a mapping utility on an actual world; dungeons are not included since they are decorations and depend on other features being present, and it also assumes the ground is always 63 blocks deep so not all of the caves shown to be exposed to the surface (green) will actually break the surface and caves down to around y=40 may not exist due to being under an ocean:
Hello there! I'm the one who found that 12 tall cactus at (0, 0) and yesterday we got a 19 tall one using multi-chunk seed finding (source). TheMasterCaver got the code analysis right but seed finding is never brute-forcing across worlds. There are way smarter ways to go about it. You can find the CUDA code used here: https://github.com/KaptainWutax/Kaktoos. The idea is to brute-force rng states right before the cactus generation code. Once such a seed is found, you simply walk back to the population seed and then back to a world seed. The theoretical max for a single chunk is indeed 90, but as you can see from the code a given chunk can place cacti in another one. Any given block actually intersects with 4 others pushing that limit to 360.