You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When implementing the NickChangeEvent event, the player returned through e.getAffected().getBase(); is not the player that triggered the event (the affected player), but the one that issued the command that initially triggered the event.
Steps to reproduce
Create a method that implements the NickChangeEvent event in a test plugin with the player affected being returned.
An example of such a function is:
@EventHandler
public void GetPlayerExample(final NickChangeEvent e) {
Player p = e.getAffected().getBase();
p.sendMessage(p.getName().toString());
}
Then trigger the event by updating the nickname of another player (not the one issuing the command)
Expected behavior e.getAffected().getBase() should return the player who triggered the event, not the one who issued the command.
The text was updated successfully, but these errors were encountered:
a11552f adds documentation to the methods indicating that they are swapped around. We can't properly address this until a breaking API revision though.
Information
Full output of
/ess version
:Server log: https://gist.github.com/SwankyNoodle/5c30d437307d79e950a94b601f398fcc#file-latest_log
EssentialsX config: https://gist.github.com/SwankyNoodle/5c30d437307d79e950a94b601f398fcc#file-essentials_config
Details
Description
When implementing the
NickChangeEvent
event, the player returned throughe.getAffected().getBase();
is not the player that triggered the event (the affected player), but the one that issued the command that initially triggered the event.Steps to reproduce
Create a method that implements the NickChangeEvent event in a test plugin with the player affected being returned.
An example of such a function is:
Then trigger the event by updating the nickname of another player (not the one issuing the command)
Expected behavior
e.getAffected().getBase()
should return the player who triggered the event, not the one who issued the command.The text was updated successfully, but these errors were encountered: