Call bukkit event

Discussion in 'Plugin Development' started by 92Garfield, Feb 5, 2012.

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

    92Garfield

    There is a function to call costum events:
    Code:
    getServer().getPluginManager().callEvent(new PlayerJoinEvent(new myPlayer, "Someone joined."));
    But using it that way, won't actualy make bukkit behave as if a player joined.
    I would guess that bukkit does not listen plugins for those events.

    So my question would be, how do I call those bukkit event correctly, so that bukkit react upon them?

    If that's not possible, how would I modify the online list (you see on TAB)?
    The join/leave messages may be done with proper broadcast, broadcastMessage or sendMessage, so that's not the problem.
     
  2. Offline

    dannycrafts

    That seems to be the correct way to invoke an event.

    If you're looking for a way to 'make' a player be online, invoking an event will not help. Invoking the event will just let plugins know a player joined, and if you're doing that for a player that hasn't actually joined, you better know what you're doing because plugins will handle the 'fake' player just like any player.
     
  3. Offline

    Lolmewn

    There's also a playerprejoinevent if I recall it correctly.
     
  4. Offline

    92Garfield

    So may I modify the playerOnlineList than?
     
Thread Status:
Not open for further replies.

Share This Page