Class PlayerUITextFieldChangeEvent

java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.ui.PlayerUITextFieldChangeEvent

public final class PlayerUITextFieldChangeEvent extends PlayerEvent
Called when a player changes a UITextField, i.e when he enters or removes any characters to/from the text field. This event is triggered for every character that is added or removed.
If you want to get an event when the player unfocuses the text field (i.e clicks somewhere outside the text field) or when he presses enter, use PlayerUIInputTextEvent instead
See Also:
  • Method Details

    • getUITextField

      public UITextField getUITextField()
      Gets the text field element that was changed.
      Returns:
      the text field.
    • getOldText

      public String getOldText()
      Gets the previous text field value (before the player entered/removed a character).
      Returns:
      the previous text field value.
    • getNewText

      public String getNewText()
      Gets the new text field value (after the player entered/removed a character).
      Returns:
      the new/current text field value.