Configurable Turtle egg hatch time #815
-
Currently, with Turtle egg spawn rate, it already takes forever, plus with the addition of Quick sleep plugins it majorly increases the time to hatch is it possible to add a config to change the hatch time? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This isn't really as straight forward as you'd might think. It's completely random when the eggs receive a random block tick, and when they do there are quite a few checks done to see if anything will even happen during this tick. See the wiki for human-readable explanation: https://minecraft.fandom.com/wiki/Turtle_Egg#Hatching In code, this looks like this: private boolean shouldUpdateHatchLevel(Level world) {
float f = world.getTimeOfDay(1.0F);
return (double) f < 0.69D && (double) f > 0.65D ? true : world.random.nextInt(500) == 0;
} Now, exposing that time of day would be pretty weird for non technical people, so I'm not going to do that. However, that 1/500 chance would be extremely simple to expose. Lower values would increase the odds of this check passing and the egg to grow to it's next stage. |
Beta Was this translation helpful? Give feedback.
This isn't really as straight forward as you'd might think. It's completely random when the eggs receive a random block tick, and when they do there are quite a few checks done to see if anything will even happen during this tick.
See the wiki for human-readable explanation: https://minecraft.fandom.com/wiki/Turtle_Egg#Hatching
In code, this looks like this:
Now, exposing that time of day would be pretty weird for non technical people, so I'm not going to do that. However, that 1/500 cha…