Solved Issues registering an event

Discussion in 'Spigot Plugin Development' started by flashpoint, Jan 7, 2020.

  1. Hi there,

    So I having an issue with registering an event to my main plugin. I am trying to make a config file for each player. (Followed this: https://www.spigotmc.org/threads/per-player-config-tutorial.103532/)

    However, OP doesn't seem to go into registering the event into your main class. When I try to do it
    getServer().getPluginManager().registerEvents(new UserDataHandler(), this); I get an error because I am missing an argument due to: public UserDataHandler(UUID userID) { my main class is stating "Expected 1 arguments but found 0". So I am kinda stuck in this spot and its running me crazy. I've looked through the tutorial thread but was unable to find info regarding that.

    I'd appetite all the help that I can get,
    thank you so much!
     
  2. That's because it's not an event. You simply use that class to create/reload the players file.
     
    • Funny Funny x 1
  3. If you want to register a listener for every player you did not follow the tutorial properly. (You should not register listeners on runtime as the handlerList has to get baked every time)

    Pls show us some of your code :D
     
  4. derp. You're right. It looks like that no file is being created and I am getting no errors at all in console. Shame :-|.

    Thank you.

    it's pretty much exactly the same. I've managed to figure it out though. Thank you. :p
     
    #4 flashpoint, Jan 7, 2020
    Last edited: Jan 7, 2020