Solved Empty BlockPopulator crashing server

Discussion in 'Plugin Development' started by Zombie__Hunter, Jun 8, 2022.

Thread Status:
Not open for further replies.
  1. Offline


    I'm trying to change the material and store the location of certain blocks when a chunk is populated. This worked perfectly in 1.18.2 however after updating my plugin and server to 1.19 it crashes every time a chunk is loaded, even after I've removed every piece of code from the populator. Are populators currently bugged or am I missing something?

    Description: Exception generating new chunk

    java.lang.NullPointerException: Cannot invoke "net.minecraft.util.RandomSource.b(long)" because "this.random" is null
    at org.bukkit.craftbukkit.v1_19_R1.util.RandomSourceWrapper$RandomWrapper.setSeed(
    at java.base/java.util.Random.<init>(
    at java.base/java.util.Random.<init>(
    at org.bukkit.craftbukkit.v1_19_R1.util.RandomSourceWrapper$RandomWrapper.<init>(
    at net.minecraft.server.level.PlayerChunkMap.lambda$31(
    at com.mojang.datafixers.util.Either$
    at net.minecraft.server.level.PlayerChunkMap.lambda$30(
    at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(
    at java.base/java.util.concurrent.CompletableFuture$
    at net.minecraft.server.level.ChunkTaskQueueSorter.b(SourceFile:62)
    at net.minecraft.util.thread.ThreadedMailbox.h(SourceFile:91)
    at net.minecraft.util.thread.ThreadedMailbox.a(SourceFile:146)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(
    at java.base/java.util.concurrent.ForkJoinTask.doExec(
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(
    at java.base/java.util.concurrent.ForkJoinPool.scan(
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(
    at java.base/


  2. Offline


    @Zombie__Hunter I don't know much about world generation, but the exception message states that "this.random" is null, so I would try initializing it.
    The parameters 'worldInfo', 'random' and 'limitedRegion' all have the @NotNull annotation, so if possible, you should probably make sure all of those are initialized.
  3. Offline


    I wish I could but the error takes place in a method inside the craftbukkit jar. I tried setting the random to a new one if it equaled null in the populate() method but it didn't change anything.
  4. Offline


    @Zombie__Hunter You can try using reflection to initialize it before you add the populator to your world.
    Apart from that, I would try building a new server jar in case it's a bug with the latest non-stable release.
  5. Offline


    I've never used reflection so far but I could look into it. Definitely going to try building a new jar though that's a good idea.

    Making a new server with a new jar fixed the issue!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 22, 2022
Thread Status:
Not open for further replies.

Share This Page