ProtocolLib

3M Downloads

[Bug]: `NbtFactory.readBlockState()` always returns null

spartacus04 opened this issue ยท 3 comments

commented
  • This issue is not solved in a development build

Describe the bug
When using the NbtFactory.readBlockState(block) method null is always returned. Other NBT libraries such as Nbt Editor work with the same block.

To Reproduce

val compound = NbtFactory.readBlockState(location.block)
val startTickCount = compound.getLong("RecordStartTick")	// NullPointerException: compound is null

Expected behavior
For compound to not be null

Version Info
https://pastebin.com/EhFTx597

Additional context
About the registered listener, you may notice in the dump that there's an additional minVersion property, that's part of my plugin that extends the RecordPacketListener. However that part already works and doesn't influence the above code.

commented

Should probably mark the method with @nullable since it can return null values

commented

Anyone?

commented

Adding my voice to the mix, for what it's worth. I'm also encountering this issue. The NbtCompound resulting from NbtFactory.readBlockState(block) is always returning null, even on chests and signs.

Minecraft 1.19.4, git-Purpur-1985
ProtocolLib 5.2.0-SNAPSHOT-685