Solved attempted to register an invalid EventHandler

Discussion in 'Spigot Plugin Help' started by SmartDeveloper, Oct 18, 2020 at 5:04 PM.

  1. Hi everyone, i wanted to make an Addon for the BedwarsReloaded plugin but when i run the plugin this error occours:
    --------------------------------------------------------------------------------------------------------------------------------------------------
    [18:00:03 ERROR]: [BedwarsRel-RB1] BedwarsRel-RB1 v1.3.1 attempted to register an invalid EventHandler method signature "public void org.smartdevs.bedwars.shop.specials.tower.ChestPlaceEvent.TowerPlace(org.bukkit.event.block.BlockPlaceEvent,io.github.bedwarsrel.game.Game,org.bukkit.entity.Player)" in class org.smartdevs.bedwars.shop.specials.tower.ChestPlaceEvent
    --------------------------------------------------------------------------------------------------------------------------------------------------
     
  2. I guess because you wrote a method like this:

    Code (Java):
    @EventHandler
    public void TowerPlace(BlockPlaceEvent event, Game game, Player player) {
    // Event stuff
    }
     
     
    • Agree Agree x 1
  3. Strahan

    Benefactor

    Yea, unless you created the event itself you have to use the constructors the event supports. You can't just make them up as you please.
     
  4. I actually fixed it, it was because the (BlockPlaceEvent event, Game game, Player player), it should be:
    (BlockPlaceEvent) {
    Player player;
    Game game;
    }
     
  5. This is exactly what @DragoFantasma_ wrote.