Solved Event not working?

Discussion in 'Plugin Development' started by Axanite, Feb 18, 2015.

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

    Axanite

    Hi, might remember me from yesterday. I am trying to make it so when I right-click a sign, information regarding what is on the sign will be sent to the player via chat. The problem with this is, when I right-click the sign (which I have told the plugin to only allow), it doesn't do anything. Nor does it do anything when I left-click the air, block or anything....

    Any help?

    http://pastebin.com/r90uEcSk
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Axanite

    Yeah:

    Code:
    public void onEnable() {
            PluginManager pm = Bukkit.getServer().getPluginManager();
            pm.registerEvents(new PlayerInteract(), this);
    }
     
  4. Offline

    WinX64

    Code:
      if(!(e.getClickedBlock() instanceof Sign)) return;
    This doesn't work, you need to check if the block's state is an instance of Sign, and not the block itself. Same for the cast below.
     
  5. Offline

    Axanite

    Ok, that worked... now its printing out "com.mysql.jdbc.JDBC4ResultSet@524ac74b" instead of the actual thing its meant to print which is the creator of the note which is gotten from the database
     
  6. Offline

    WinX64

  7. Offline

    Axanite

Thread Status:
Not open for further replies.

Share This Page