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

the ChangeDimension packet doesnt appear to exist (Change the nether portal destination) #23

Closed
JSJBDEV opened this issue Dec 16, 2020 · 5 comments
Labels
enhancement New feature or request paused Waiting for more people to have this problem

Comments

@JSJBDEV
Copy link

JSJBDEV commented Dec 16, 2020

I am using the code

netevent.raw(PacketId.ChangeDimension).on((ptr,size)=>
{
console.log(Packet Id: ${ptr.readUint8()});
const dimension = ptr.readVarInt();
const x = ptr.readFloat32();
const y = ptr.readFloat32();
const z = ptr.readFloat32();
console.log(changing dimension: ${dimension} ${x} ${y} ${z});

});

but I never get a response, furthermore, it doesn't seem to appear in console for being received as a packet at all, am I doing something wrong or is this a bug?
(I have tested this with entities and players moving between the nether and overworld, and a player into the end)

@JSJBDEV
Copy link
Author

JSJBDEV commented Dec 18, 2020

so I actually did a bit of research into this and found that the PlayerAction for change dimension is called when you arrive at your new dimension which works to some extent, but I would like to be able to interupt and modify this action to change where there portal leads

@karikera
Copy link
Collaborator

it seems the change dimension packet is sent from the server.
and I realized send packet listeners are broken.
btw if you cancel the sent packets. the game will make a glitch about this.

it seems it's not easy to change the portal task.

@karikera karikera changed the title the ChangeDimension packet doesnt appear to exist the ChangeDimension packet doesnt appear to exist (Change the nether portal destination) Dec 18, 2020
@karikera karikera added the enhancement New feature or request label Dec 18, 2020
@JSJBDEV
Copy link
Author

JSJBDEV commented Dec 18, 2020

Im starting to write some other methods and programs for a project im working on so If I come across any other things I will make an issue. when you say send packet listeners are broken, do you mean that I cant send packets? from what I can tell it is the only way to construct a modal form to the player

@JSJBDEV
Copy link
Author

JSJBDEV commented Dec 18, 2020

if I cant change the portal task I can try and find other things like it.

@JSJBDEV
Copy link
Author

JSJBDEV commented Dec 18, 2020

since I dont think this deserves another issue as it may be related, I was trying to send a ModalFormRequest to the player so I modified the example code where a text packet is sent to do this

// sendPacket
    setTimeout(()=>{
        console.log('packet sended');

        const fancyPacket = createPacket(PacketId.ModalFormRequest);
        fancyPacket.setUint16(0);
        fancyPacket.setString(`{"type": "form","title": "test title","content":{},"buttons":{}}`);
        sendPacket(networkIdentifier,fancyPacket);
        fancyPacket.dispose();
    }, 10000);

but I keep on getting Error: Structured Exception: STATUS_ACCESS_VIOLATION(0xC0000005) (specifically on the sendPacket line) which I see is because of what looks like malformed strings in the code, am I doing this wrong?

@karikera karikera added the paused Waiting for more people to have this problem label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request paused Waiting for more people to have this problem
Projects
None yet
Development

No branches or pull requests

2 participants