Plugin isn't working

Discussion in 'Plugin Development' started by wolfroe, Jun 19, 2020.

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

    wolfroe

    First of all, I am trying to make a plugin for my own server. It's supposed to make creepers explode faster, stop skeletons from burning and give zombies armor. The plugin loads without errors, but it doesn't work. It might be that it doesn't call upon the listener whenever an event happens but honestly i have no idea.

    I've put the main and listener classes in text files.
    Any help would be appreciated.
     

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    wolfroe

    @timtower what do you mean by does the event fire?
     
  4. Offline

    Strahan

    He means does the event actually run when a creature spawns. Throw a debugger line in there first thing in the onSpawn and see if the debug msg appears when a creature spawns.

    Also you can check the types just by doing if (mob.getEntityType() == EntityType.ZOMBIE) for example. No need for .equals or for casting. Though given the way you are using it, switching on getEntityType() would be cleaner IMO. Also you don't need to prefix methods in the same class with "this". It assumes this if you do not specify it.
     
Thread Status:
Not open for further replies.

Share This Page