event doesn't exist

Discussion in 'Plugin Development' started by jeroenh2003, Aug 20, 2017.

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

    jeroenh2003

    Im working on a scoreboard plugin that shows all information needed to play the game.
    I have a line that shows your chatchanel that you're talking in.
    i've imported the channeljoinevent from Venturechat and used it to get the channelname.

    But when i start the server, the console says that the channelJoinEvent doesn't exist.

    here is my code:
    Code:
    import mineverse.Aust1n46.chat.api.events.ChannelJoinEvent;
    
    
    @EventHandler
        public void onChannelJoin(ChannelJoinEvent e) {
            ChatChannel channel = e.getChannel();
            s4 = o.getScore("Chat Channel: " + channel.getColor() + channel);
        }
    the class of the event is public and the plugin itself is imported in the plugin and also in the plugins folder in the server..

    this is the error in the console:

    [18:32:26 INFO]: [Geoboards ] Enabling Geoboards v0.1
    [18:32:26 INFO]: [Geoboards ] Geoboards geactiveert!
    [18:32:26 INFO]: [Geoboards ] Plugin Geoboards v0.1 has failed to register events for class com.jhc.geocraft.geoboards.Geoboards because mineverse/Aust1n46/chat/api/events/ChannelJoinEvent does not exist.
     
  2. Offline

    Reflxction

    ClassNotFoundException occurs when you have an imported class in your project, but this class is not in the plugins folder. You have to put the hook/api or whatever in your plugins folder, then it should work
     
  3. Offline

    jeroenh2003

    as i said the plugin is imported in the scoreboard plugin and is also in the plugins folder of the server
     
  4. Offline

    timtower Administrator Administrator Moderator

    TheTrixsta likes this.
  5. Offline

    jeroenh2003

  6. Offline

    Lammazz

    @jeroenh2003 You must depend on any plugin which contains classes you reference to in your plugin. You do this in your plugin's plugin.yml, with the "depend" attribute.
     
    TheTrixsta likes this.
  7. Offline

    jeroenh2003

    oke, but thats weird. i also used vault and pex but i they work and i havent depend on them.

    i dont get the event message anymore, but now i get the message that my plugin en venturchat couldn't be loaded because of unknowndependencyexeption
     
    Last edited: Aug 24, 2017
  8. Offline

    Horsey

    It's pure luck that Vault and PEX loaded before your plugin.

    It's because your server doesn't have VentureChat as a plugin.
     
  9. Offline

    timtower Administrator Administrator Moderator

  10. Offline

    jeroenh2003

  11. Offline

    Horsey

    @jeroenh2003 VentureChat did not load because it requires ProtocolLib.
     
  12. Offline

    jeroenh2003

    @Horsey tnx.. But i still need the sollution to the main problem
     
  13. Offline

    jeroenh2003

    no one knows the answer to my problem?
     
  14. Offline

    Zombie_Striker

    @jeroenh2003
    Have you installed protcol lib? Have you added a dependency for it? Did that fix the problem?
     
Thread Status:
Not open for further replies.

Share This Page