Minecraft – Does the number of farmland blocks around Melon or Pumpkin plants increase the rate of growth

minecraft-java-edition

Does the number of farmland blocks around Melon or Pumpkin plants increase the rate of growth?

Is 1 Farmland beside the Melon or Pumpkin seed less effective in growing the crop?
1 Farmland

Or is 4 Farmland beside the Melon or Pumpkin seed more effective?

4 Farmland

Best Answer

I'm going to borrow the code for Melon/Pumpkin growing from John's answer to a related question:

int i1 = random.nextInt(4);
int j1 = i;  // Assuming j1 and k1 are the horizontal axes...
int k1 = k;
if(i1 == 0)  // North
{
    j1--;
}
if(i1 == 1) // South
{
    j1++;
}
if(i1 == 2) // East
{
    k1--;
}
if(i1 == 3) // West
{
    k1++; // or somthing like that, anyway.
}
if(world.getBlockId(j1, j, k1) == 0 && world.getBlockId(j1, j - 1, k1) == Block.tilledField.blockID)  // Make sure the targeted block is empty and below it is farmland...
{
    world.setBlockWithNotify(j1, j, k1, field_35297_a.blockID); // Place a melon.
}

This code works by first picking a direction, then checking if it is farmland, and then placing a melon/pumpkin if it is. Therefore you will get higher yield if there are more farmland blocks around the vine, as if you only have 1 there is only a 1/4 chance of this function creating a melon/pumpkin when it is triggered.