Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set client skin using send player_skin packet #546

Open
afarhansib opened this issue Nov 18, 2024 · 3 comments
Open

Cannot set client skin using send player_skin packet #546

afarhansib opened this issue Nov 18, 2024 · 3 comments

Comments

@afarhansib
Copy link

i successfully capture player_skin packet when other player changing their skin, but when i send it back, my skin does not change

i capture it like this

this.client.on('packet', (packet) => {
            // console.log(packet)
            if (packet?.data?.name === 'player_skin') {
                console.log('Received skin packet:', packet.data)
                // Store the skin packet
                const skinsDir = path.join(__dirname, 'skins')
                if (!fs.existsSync(skinsDir)) {
                    fs.mkdirSync(skinsDir)
                }
                fs.writeFileSync(
                    path.join(skinsDir, 'captured_skin.json'),
                    JSON.stringify(packet.data.params, null, 2)
                )
            }
        })

and send it back later

sendSkinPacket() {
        const skinPacket = JSON.parse(fs.readFileSync(path.join(__dirname, 'skins', 'captured_skin.json')))
        console.log(skinPacket)
        this.client.queue('player_skin', skinPacket)
    }

is this even the way to do this, or currently we cannot set client skin?

@extremeheat
Copy link
Member

Can you explain more what exactly you're trying to do? Is this a client or a relay proxy?

@afarhansib
Copy link
Author

i am trying to make a bot client just using this, and i want to set my skin so its not default steve/alex

@TSL534
Copy link

TSL534 commented Dec 13, 2024

Use the Client Creat skinData Option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants