Skip to content

Cannot read field "captureTreeGeneration" because it failed to get world data #150

@Elikill58

Description

@Elikill58

Expected behavior

Be able to get block type.

Observed/Actual behavior

Error when using block.getType() :

java.lang.NullPointerException: Cannot read field "captureTreeGeneration" because the return value of "net.minecraft.world.level.World.getCurrentWorldData()" is null
        at net.minecraft.world.level.World.a_(World.java:813)
        at org.bukkit.craftbukkit.v1_20_R1.block.CraftBlock.getType(CraftBlock.java:242)

Steps/models to reproduce

Use player.getLocation().getBlock().getType() when receiving player packet, then join on server

Plugin and Datapack List

  • Negativity v2.7-SNAPSHOT (my own - fixing Folia support actually)

Folia version

This server is running Folia version git-Folia-"f6e91e9" (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: f6e91e9)
You are running the latest version

Other

I think the fact it comes from packet reader can be important to reproduce the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething doesn't work as it was intended to.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions