PaperMC / PaperMC/adventure

Issues with vanilla minecraft nbt handling

Open
#810 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: nbt type: enhancement
Dominant language
Java
Stars
887
Forks
160
PR merge metrics
No merged PRs in 30d

Description

Hello, I am having issues with adventure-nbt.
I need to read a nbt tag that may be an end tag or a compound tag out of a DataInput, it should be null if it is an end tag and the compound tag if it is the compound tag and the whole tag should be read out of the DataInput.

This behaviour is normal for minecraft vanilla so it would be good if something like this will be implemented soon.

I am using BinaryTagIO.reader().read(...) and the error is:
java.io.IOException: Expected root tag to be a BinaryTagType[CompoundBinaryTag 10], was BinaryTagType[EndBinaryTag 0]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at BinaryTagIO.reader().read(...) and inspect how root BinaryTag types are handled when reading from a DataInput. Confirm the expected behavior for an EndBinaryTag versus a CompoundBinaryTag, then verify that the entire tag is consumed and the end-tag case returns null.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.