Abnormal Plugin Type

Discussion in 'Plugin Development' started by NoU_X2, Jul 11, 2020.

  1. Offline

    NoU_X2

    Hello I'm trying to make a new plugin but I have this error


    [22:33:01] [Server thread/WARN]: Plugin LightningRod v1.0 does not specify an api-version.
    [22:33:01] [Server thread/ERROR]: Could not load 'plugins\Li8ghtningRod.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[bukkit.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[bukkit.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:334) ~[bukkit.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:253) [bukkit.jar:git-Spigot-800b93f-8160e29]
    at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadPlugins(CraftServer.java:351) [bukkit.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:203) [bukkit.jar:git-Spigot-800b93f-8160e29]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:784) [bukkit.jar:git-Spigot-800b93f-8160e29]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
    Caused by: java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_251]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_251]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_251]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:72) ~[bukkit.jar:git-Spigot-800b93f-8160e29]
    ... 7 more
     
  2. Offline

    timtower Moderator Moderator

    @NoU_X2 You have a constructor don't you?
    If so: remove it.
     
  3. Offline

    NoU_X2

    I'm fairly new to this stuff but can you please tell me which of these are the constructors and i will remove it ASAP
    Code:
    package me.NoU_x2.Li8ghtningRod;
    
    import javax.annotation.Nonnull;
    
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import io.netty.handler.codec.http2.Http2Connection.Listener;
    
    public abstract class Main extends JavaPlugin implements Listener{
      
        public void onEnable() {
            getServer().getPluginManager().registerEvents(([email protected] Listener)this, this);
        }
      
        @SuppressWarnings("deprecation")
        @EventHandler
        public void onPlayerInteract(PlayerInteractEvent event) {
            Player player = event.getPlayer();
            if (player.getItemInHand().getType() == Material.STICK) {
                player.getWorld().strikeLightning((@Nonnull Location) player.getTargetBlock(null, 200));
            }
        }
      
    }
     
    Last edited by a moderator: Jul 11, 2020
  4. Offline

    timtower Moderator Moderator

    @NoU_X2 Remove the abstract keyword
     
  5. Offline

    NoU_X2

    I have done it but its still saying the same thing. Abnormal plugin type, is there anything else to remove?
     
  6. Offline

    The_Spaceman

    @NoU_X2 Shouldn't you implement 'org.bukkit.event.Listener' in stead of 'io.netty.handler.codec.http2.Http2Connection.Listener'?
     
  7. Offline

    NoU_X2

    I have replaced it now, thank you for your help but it didn't fix anything for all I know.
     
  8. Offline

    timtower Moderator Moderator

  9. Offline

    NoU_X2

    Yup I have removed that and this is what I have currently. Still for some reason came up with the same message
    Code:
    package me.NoU_x2.Li8ghtningRod;
    
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.event.Listener;
    
    public class Main extends JavaPlugin implements Listener{
       
        public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
        }
       
        @SuppressWarnings("deprecation")
        @EventHandler
        public void onPlayerInteract(PlayerInteractEvent event) {
            Player player = event.getPlayer();
            if (player.getItemInHand().getType() == Material.STICK) {
                player.getWorld().strikeLightning(player.getTargetBlock(null, 200).getLocation());
            }
        }
       
    }
     
    Last edited by a moderator: Jul 11, 2020
  10. Offline

    timtower Moderator Moderator

    @NoU_X2 Please make sure that you are actually updating the correct jar.
    That error should be changing.
     
  11. Offline

    NoU_X2

    I have been updating the correct jar. I even went into the server and typed /plugins and I couldn't see my plugin on the list at all

    EDIT
    Nevermind It works now. There was another .jar in my left hand thing they had old things on it and all I had to do was remove em. Thanks for your help guys!!!!!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited: Jul 12, 2020

Share This Page