# Shulker Farm Failure Rate

I built a shulker farm following the design by devilmok. Centered on the trapped shulker, there are 4 nether portals with 17x17 portal blocks. These are spaced apart with blocks in between to allow shulkers to teleport to. This image taken from devilmok's video shows the side view.

According to the wiki, when the shulker wants to duplicate, it chooses a random block within 17x17x17 space centered on itself and tries teleporting to it, repeating if the block is invalid up to 4 more times (with a total of 5 times). Since there are 8 17x17 planes next to portal blocks it can teleport to, this gives a duplicate failure rate of p = (1 - 8/17)5 = 0.0416.

Shulkers have 30 health and deals 4 damage per hit. Since shulkers duplicate after being hit as long as they have over half health, the shulker can fail to duplicate 4 times before breaking the farm.

To calculate the mean time between failure, we calculate the average number of hits it takes to see 4 consecutive failures. This turns out to be (1 + p + p2 + p3)/p4 = 348400. If each hit takes ~2 seconds, this equates to ~8 days.

In minecraft 1.17, 8 days sounds about right: the farm never broke. But recently after I upgraded to 1.18.2, it broke 4 times on me within a week. Did something change? Or is my calculation off and I just got really lucky in the past? Or am I unbelievably unlucky?