Chat Messages (Help)

Discussion in 'Plugin Development' started by RazorFlint, Jul 24, 2012.

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


    Hi, I haven't coded in about a year now and I'm pretty dumbfounded why this doesn't work, could someone help me out?

    Thanks :D
  2. Offline


    Your event handling is just setup incorrectly.
    import org.bukkit.event.Listener;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.player.PlayerLoginEvent;
    public class LoginPlugin extends JavaPlugin implements Listener {
    public void onEnable() {
    getServer().getPluginManager().registerEvents(this, this);
    public void normalLogin(PlayerLoginEvent event) {
    // Some code here
  3. Offline

    chaseoes Retired Staff

  4. Offline


    Thank you! And much appreciated!

    chaseoes Another thing, why won't this and operator work in this if statement?

    if(lc.contains("who") && ("is")){
    //some code here

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 27, 2016
  5. Offline


    lc.contains("who") returns true or false, while ("is") isn't a statement. You need to use lc.contains("is")

    Statement && Statement
  6. Offline


    Does that even work ?

    Maybe like this:
    if(lc.contains("who") && lc.contains("is")){
    //some code here
  7. Offline


    Yes, I'm a bit of an idiot to forget about that, thanks WarmakerT :)
  8. Offline


    No problem =)
Thread Status:
Not open for further replies.

Share This Page