[Solved] Get the player who caused SignChangeEvent

Hello!
I have a SignChangeEvent and want to get the Player, who caused this event.

@Subscribe
public void onSignChange (SignChangeEvent event) {
        log.info(event.getCause().get().getCause().toString());
}

This returns something like this:

EntityPlayerMP[‘ibot3’/18, l=‘world’, x=920,73, y=68,00, z=464,58]

How can I turn this into a player object? (For example to send a message to the player)

Hey, I have no idea if this is viable or not (I’m still learning), but this should work:

    @Subscribe
    public void onSignChange (SignChangeEvent event) {
            Object o = event.getCause().get().getCause();
            Player p = (Player) o;
            p.sendMessage(Texts.of("hi"));
    }
1 Like

It probably won’t. Cause is no implemented yet, but it is worked on.

1 Like

It’s working. Thank you!

2 Likes

Thank you! Was about to start a topic for the same question.