1.8.8 HolographicDisplays API - TouchHandler error, help

Discussion in 'Spigot Plugin Development' started by Brando, Mar 26, 2020.

  1. I have an error in the console when executing the following code:

    public class CtwPlugin extends JavaPlugin implements Listener {

    //*************VARIABLES***********************
    Hologram HoloTeams;
    //=============================================

    @Override
    public void onEnable() {

    try {
    Bukkit.getPluginManager().loadPlugin(Bukkit.getPluginManager().getPlugin("HolographicDisplays").getDataFolder());
    Bukkit.getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin("HolographicDisplays"));
    } catch (UnknownDependencyException | InvalidPluginException | InvalidDescriptionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();}

    HoloTeams = HologramsAPI.createHologram(this, new Location(Bukkit.getWorld("world"), -12.8, 78, 0.5));
    HoloTeams.appendTextLine(ChatColor.translateAlternateColorCodes('&',"&9&l"+azules+"&a&l/&4&l"+rojos));

    TouchableLine a = (TouchableLine) HoloTeams.getLine(0);

    TouchHandler b = new TouchHandler() {
    @Override
    public void onTouch(Player p) {
    // TODO Auto-generated method stub
    p.sendMessage("ON TOUCHHH!!");

    }
    };

    a.setTouchHandler(b);
    }



    ERROR:

    Could not load 'plugins\CTW.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:739) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.Bukkit.reload(Bukkit.java:535) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
    Caused by: java.lang.NoClassDefFoundError: com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_231]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_231]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    ... 14 more
    Caused by: java.lang.ClassNotFoundException: com.gmail.filoghost.holographicdisplays.api.handler.TouchHandler
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_231]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_231]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_231]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_231]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_231]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8-R0.1.jar:git-Spigot-db6de12-18fbb24]
    ... 14 more
     
  2. U are using wrong version of HolographicDisplays