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

Player Button Click Simulation Fails Using ServerboundUseItemOnPacket #864

Open
huangdihd opened this issue Oct 19, 2024 · 0 comments
Open

Comments

@huangdihd
Copy link

I tried to use the following code:

session.send(new ServerboundUseItemOnPacket(
        Vector3i.from(
            arguments.BTN_X,
            arguments.BTN_Y,
            arguments.BTN_Z
        ),
        Direction.from(arguments.BTN_DIR),
        Hand.MAIN_HAND,
        .5f, .5f, .5f,
        true,
        (int) Instant.now().toEpochMilli()
));
session.send(new ServerboundUseItemPacket(
        Hand.MAIN_HAND,
        (int) Instant.now().toEpochMilli(),
        0f, 0f
));

to simulate the player clicking a button, but it failed. Can anyone help me?

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

1 participant