PrismarineJS / PrismarineJS/minecraft-data
[question] What does `big` mean in bitflags
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 938
- Forks
- 294
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 25
Description
Hey, I’ve been going over the various types in protocol.json, and I noticed that the bitflags type sometimes includes a boolean field named big.
I’m trying to understand what this field actually means. My assumption is that it’s related to endianness, but how should that be interpreted here exactly?
For example, in Bedrock 1.21.100, the type protocol/types/InputFlag looks like this:
[
"bitflags",
{
"type": "varint128",
"big": true,
"flags": [
"ascend",
"descend",
"north_jump",
"jump_down",
"sprint_down",
"change_height",
"jumping",
"auto_jumping_in_water",
"sneaking",
"sneak_down",
"up",
"down",
"left",
"right",
"up_left",
"up_right",
"want_up",
"want_down",
"want_down_slow",
"want_up_slow",
"sprinting",
"ascend_block",
"descend_block",
"sneak_toggle_down",
"persist_sneak",
"start_sprinting",
"stop_sprinting",
"start_sneaking",
"stop_sneaking",
"start_swimming",
"stop_swimming",
"start_jumping",
"start_gliding",
"stop_gliding",
"item_interact",
"block_action",
"item_stack_request",
"handled_teleport",
"emoting",
"missed_swing",
"start_crawling",
"stop_crawling",
"start_flying",
"stop_flying",
"received_server_data",
"client_predicted_vehicle",
"paddling_left",
"paddling_right",
"block_breaking_delay_enabled",
"horizontal_collision",
"vertical_collision",
"down_left",
"down_right",
"start_using_item",
"camera_relative_movement_enabled",
"rot_controlled_by_move_direction",
"start_spin_attack",
"stop_spin_attack",
"hotbar_only_touch",
"jump_released_raw",
"jump_pressed_raw",
"jump_current_raw",
"sneak_released_raw",
"sneak_pressed_raw",
"sneak_current_raw"
]
}
]
There are 65 flags here for a varint128 with "big": true. How should I interpret this?
I understand that Minecraft varints themselves are always little-endian, so I don’t suppose this flag refers to byte order. My current theory is that it's about the bit order - that is, whether flag 0 corresponds to the most significant bit or the least significant bit.
Is that correct? Or does "big" mean something else in this context?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading protocol.json and the bitflags definition, then inspect the InputFlag entry and any code or documentation that consumes varint128 fields. Determine what the big property controls and document how the 65 listed flags map to the value; the issue is done when that interpretation is stated clearly and supported by the schema or implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100