PrismarineJS / PrismarineJS/minecraft-data

How can find the description for switches?

Open
#863 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
938
Forks
294
Avg merge
3d 5h
Merged PRs (30d)
25

Description

I'm trying to generate the protocol based on the specifications on this repo, but I can't tell where I should be looking to understand what's the description for switches cases.

Taking the boss_bar packet as an example, how can I tell the variants names like here (add, remove, update health, etc.)?

Right now what I managed to generate is:

pub enum BossBarResponse_Enum<'p> {
    Variant_0 { title: &'p str, health: f32, color: i32, dividers: i32, flags: u8 },
    Variant_2 { health: f32 },
    Variant_3 { title: &'p str },
    Variant_4 { color: i32, dividers: i32 },
    Variant_5 { flags: u8 },
}

Which is quite unhelpful for whomever tries to use the packet. I don't see how I could generate this better. Also I don't see how I can figure out that 1: remove is even a valid choice for this packet.

Thanks.

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 with data/pc/1.20.2/protocol.json and the boss_bar packet section linked in the issue, then compare its switch cases with the linked wiki.vg protocol entry. Determine where variant descriptions and the missing choice are represented; the issue is complete when a newcomer can identify the named boss-bar variants from the repository data.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.