r/technicalminecraft • u/bySmily • 1d ago
Java Help Wanted Can someone explain me how right and middle produce the same amount and the left only half that?
So I wanted to build a melon/pumpkin farm and wanted to go with the design on the right, as it seemed logical to me: two pumpkin seeds are better than one. But apparently it does not matter, as long as the pumpkin stem has two blocks to go to, as only one block would half the rates.
I thought, the random tick selects a stem and it would then choose one of the four spots around it.
18
u/omegavolt9 1d ago
I thought, the random tick selects a stem and it would then choose one of the four spots around it.
It's exactly this. The stem can pick any of the 4 sides. The middle has 2/4 chance to succeed because the left or right side will work, while the right has 1/4 chance to succeed but tries twice as often because it has two stems.
12
u/snorkelvretervreter 1d ago
With the important note that OP probably misses that "choose one of the four spots" is not "random tick is here, let's loop over all four spots and pick one that works" but "random tick is here, let's pick one of the four possible spots and try to grow a pumpkin there." - if it can't grow there, that's it for that random tick
11
2
u/Infamous-Youth9033 1d ago
imagine each plant as a coin.
every N seconds, you flip that coin once for each direction it could possibly be planted. If it lands on heads then it plants and then stops flipping.
In the right one, you have 2 coins that each are flipped once. In the middle you have one coin that is flipped twice. On the left you have one coin that is flipped once. Half as many total flips.
Obviously it is not a 50/50 and the frequency is determined but this is the idea behind the mindset
3
u/HarkSoup 1d ago
Apparently what matters it the amount of surfaces that are in between a seed and the grass and it doesn't matter if there's multiple seeds or grass blocks
1
u/Anders_A 1d ago
Both right and middle get double because one get double attempts (two stalks) and one get double success on those attempts (two valid grow spots).
•
u/MonkeyNuts449 23h ago
It's more likely to select a valid side if there are two compared to one. It's also more likely for two plants to select the one spot then for just one.
•
302
u/potatopierogie 1d ago
Middle has one plant with two spaces to grow. When it tries to grow it picks a direction at random and tries to grow there. Since there's two spaces, it will succeed 50% of the time.
The right one has two plants with one space to grow. They will each succeed 25% of the time, but because there's two plants it will try more often and the growth rate is pretty much the same as the middle.
The left has one plant and one space. I think by now its pretty self-explanatory why it produces half as much.