4

We already know that in Minecraft 1.16, an end portal can generate with 12 eyes of ender already placed, such as in the seed -4530634556500121041. The odds of this are calculable: 0.1^12 = 1 / 1 trillion.

Recently the seed 2483313382402348964 which generates the following end portal was discovered: Glitched end portal generation

For all practical purposes this is a complete portal, since it gives immediate access to the end. Then the actual odds of a "complete" portal are higher than 1 / 1 trillion. Do we have an estimate or actual value for the odds of a complete portal, including this case?

I've noticed that the completed part of the portal is in a different chunk than the rest of the portal, which is probably a hint as to why the generation happened like this.

Chunks marked

1
  • Sounds like a challenge for Minecraft @ Home – aytimothy Mar 3 at 8:39
3

This is what I believe based on 1.16.4 MCP Reborn decompiled code.

The end portal will only generate if all eyes are placed in which sets flag. And if 1.16 is like previous versions, the RNG is seeded per chunk, so a portal can cover 4 chunks, but the chunk with the glitched portal still requires 12 eyes to spawn chance. Source: zolsticezolstice (moderator of r/MinecraftSpeedrun)

So the chance is still on the order of 1/1 trillion rather than 1/6400, but increased due to portals generating over multiple chunks.

From StrongholdPieces.java:

         boolean flag = true;
         boolean[] aboolean = new boolean[12];

         for(int l = 0; l < aboolean.length; ++l) {
            aboolean[l] = p_230383_4_.nextFloat() > 0.9F;
            flag &= aboolean[l];
         }

         this.setBlockState(p_230383_1_, blockstate6.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[0])), 4, 3, 8, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate6.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[1])), 5, 3, 8, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate6.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[2])), 6, 3, 8, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate2.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[3])), 4, 3, 12, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate2.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[4])), 5, 3, 12, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate2.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[5])), 6, 3, 12, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate3.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[6])), 3, 3, 9, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate3.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[7])), 3, 3, 10, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate3.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[8])), 3, 3, 11, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate4.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[9])), 7, 3, 9, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate4.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[10])), 7, 3, 10, p_230383_5_);
         this.setBlockState(p_230383_1_, blockstate4.with(EndPortalFrameBlock.EYE, Boolean.valueOf(aboolean[11])), 7, 3, 11, p_230383_5_);
         if (flag) {
            BlockState blockstate7 = Blocks.END_PORTAL.getDefaultState();
            this.setBlockState(p_230383_1_, blockstate7, 4, 3, 9, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 5, 3, 9, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 6, 3, 9, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 4, 3, 10, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 5, 3, 10, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 6, 3, 10, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 4, 3, 11, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 5, 3, 11, p_230383_5_);
            this.setBlockState(p_230383_1_, blockstate7, 6, 3, 11, p_230383_5_);
         }

My guess is p_230383_4_ is the Random object that does the RNG which comes from generateFeatures in Biome.java, which comes from SharedSeedRandom, which is seeded per chunk.


For the sake of having some numbers, let's assume the portal generating per chunk assumption is correct, and also the portal center is chosen uniformly within a 16x16 chunk. Then if the portal center is on one edge of the chunk, end portals are calculated over two chunks, and if the portal center is in a corner of a chunk, end portals are calculated over 4 chunks. So the two chunk case has 4*14=56 possible positions and the chance of at least one chunk having a 12-eye RNG is 1-(1-10^-12)^2 ≈ 2*10^12, and the four chunk case has 4 possible positions with chance 1-(1-10^-12)^4 ≈ 4*10^-12. The total chance is now about (196 + 2*56 + 4*4)/256 * 10^-12 ≈ 1.266 * 10^-12, so about 25% more likely as the original 1 / 1 trillion chance, but still on the same order of magnitude of nearly impossible.

0

80999999999980000000000003999999999999/64000000000000000000000000000000000000000000000000

or 1.265624999999687500000000062499999999984375 / 1 Trillion

assuming that if portal crosses chunk boundary, it has more chances to be complete, but in every chunk is still needs 12 successes and my calculations are correct.

if portal blocks only care about frame blocks that actually exist in the chunk, my previous answer applies:

198601793977/1024000000000000 or 0.01939470644306640625%

if my calculations are correct.

considering only that 1x1 corner, it needs:

  • that vertical chunk border is inside the portal (2 of 16 possible positions, assuming portal is equally likely to spawn anywhere, assumption not checked)
  • same for horizontal
  • that vertically touching frame be filled (1 of 10 chance)
  • same for horizontally

so assuming those are independent (should be) we get (2/16)^2*(1/10)^2=1/6400=0.015625%; analyzing other possibilities for portal does increase chance, but only a bit.

6
  • Your answer seems to be on the right order, given your assumptions. There's a competing theory that I saw that suggested the eyes are not placed independently, but rather the eye layout of the entire frame was determined by the chunk that the portal spawns in. In other words, a portal with 2 eyes in a different chunk would still only have a 1/10^12 chance of generating "complete" on that corner. I can't verify either theory, but 1/6400 seems likely enough that I'd expect a "complete" portal to have come up in a real random seed already. I don't know of any such cases though. – Edward Mar 8 at 3:48
  • 1
    So the very important assumption is that the corner eyes being filled makes the glitch portal appear, which is not supported by the decompiled code (at least not in a straightforward way) – qwr Mar 28 at 21:39
  • @qwr a glitch may not be straight forward! When you get buried in functions a glitch can seem to come out of nowhere, hence it being a bug. The chance that that bug still exists in a team-project and it being straight forward seems pretty minimal in my eyes. – Penguin Mar 29 at 5:48
  • @Penguin the issue is as mentioned by Edward that if the chances were really 1/6400, then there should be many people running into bugged portals, whereas the real chances seem extremely low. – qwr Mar 29 at 7:27
  • how did you do your portal crossing counting? I did my calculations based on the portal center having to be on the boundaries of a chunk, so at least two chunks could calculate portal blcoks. – qwr Mar 29 at 7:43
-2

I assume that you would have to account for all possible ways a corner can be separated by a chunk and also have no empty eye slots. That would mean a 2 by 2 and a 1 by 1 in any of the 4 corners, so 8 different portal configuration, plus 1 for the 3 by 3 configurations. That would increase the number of "completed" portals to 9. Meaning the chance would go from 1/1 trillion to 9/1 trillion. That would mean that, in practice, the probability of a "completed" portal is essentially the same. Of course, that is without including the probability that a chunk separates a single corner like it has in the seed you show. I assume that would actually decrease the probability to below 9/1 trillion. Another thing that may have to be looked at is whether a glitched 1 by 2, 1 by 3, or 2 by 3 portals can occur. I did not include that as it cannot be confirmed without finding a seed, but it would only increase the probability to 25/1 trillion anyways, so still basically inconsequential. Don't quote me on any of this though, cause the math might be more complex than I am assuming it is. I spent way to much time on this, but I hope that helps.

2
  • I don't believe this is right since (among other reasons) you haven't accounted for the probabilities of the different split portals appearing. – Edward Mar 7 at 17:44
  • I'm fairly good at math but I'm missing the specifics of how portal generation works to calculate this myself. – Edward Mar 7 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.