1.15.2 Getting errors on OnPlayerJoin event

Discussion in 'Spigot Plugin Development' started by Bluehawk409, Sep 13, 2020.

  1. I am getting multiple errors in this code when I shouldn't. I have imported all the proper imports and have saved the files and still don't know the issue:

    Code (Text):
    @EventHandler
             public void onPlayerJoin(PlayerJoinEvent event2) Error: void is an invalid type for OnPlayerJoin
                {
                    Player p = event.getPlayer();   Error: The method getPlayer() is undefined for the type EntityDeathEvent
                    if(event.getPlayer().hasPermission("soultree.speedi")) Error: The method getPlayer() is undefined for the type EntityDeathEvent
                    {
                 
                    p.sendMessage("You have retained your speed upgrade!");
                    }
                }
     
  2. You save your event variable as event2, but call it as event. I presume 'event' is the name of another event (EntityDeathEvent?)
     
  3. I figured it out, sorry for the dumb question.
     
  4. So it works now?
     
    • Like Like x 1