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

Send event when Geyser shows other player to client #4551

Closed
tomhmagic opened this issue Apr 6, 2024 · 0 comments · Fixed by #4507
Closed

Send event when Geyser shows other player to client #4551

tomhmagic opened this issue Apr 6, 2024 · 0 comments · Fixed by #4507
Labels
Feature Request A feature request.

Comments

@tomhmagic
Copy link
Sponsor

What feature do you want to see added?

Send off an event when Geyser shows/spawns a player for the client to return both connections in the API

I made something similar using ProtocolLib and listening to their spawnEntity packet, filtering if it was a player and then sending both players to this event. However it would be nice to handle this with connections being passed through.

public class PlayerEnterRenderEvent extends Event {
    private static final HandlerList handlers = new HandlerList();
    private final Player observer;
    private final Player enteringPlayer;

    public PlayerEnterRenderEvent(Player observer, Player enteringPlayer) {
        this.observer = observer;
        this.enteringPlayer = enteringPlayer;
    }

    public Player getObserver() {
        return observer;
    }

    public Player getEnteringPlayer() {
        return enteringPlayer;
    }

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }
}

Are there any alternatives?

As above I've created my own Bukkit version using ProtocolLib. However it won't work for Bedrock players as it is called before the client received the player from geyser.

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

Successfully merging a pull request may close this issue.

1 participant