eventListener response to player that created event?

Discussion in 'Plugin Development' started by Joshua Burt, Jan 28, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Joshua Burt

    I have a custom event listener which needs to call sendMessage on the player object which created the event that the listener caught.

    Any thoughts on how to accomplish this? I'm stumped. :p
    --- merged: Jan 28, 2011 3:49 PM ---
    So I've stored the player object in the plugin class when the player chat event is caught. I'm able to reference it later in the other listener class. It works, but I don't know if this is really the best way. Let me know if you come up with a better way! Thank you!
     
  2. Offline

    Afforess

    Minecart Mania creates a custom event listener, with custom events. See it's source code.
     
  3. Offline

    DerpinLlama

    Code:
        public void onEntityDerp(EntityEvent event){
        	event.getPlayer().sendMessage("herp");
        }
     
Thread Status:
Not open for further replies.

Share This Page