Solved PacketPlayInClient/CraftPlayer

Discussion in 'Plugin Development' started by elian1203, Oct 20, 2015.

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

    elian1203

    Until today, I've used the spigot jar to code and compile my plugins. Yesterday I started using the api, and today I removed the jar. The only error I've received upon doing this is not being able to use PacketPlayInClient and CraftPlayer to perform a respawn command.
    Here's the code, though it's not very necessary, as the files don't exist.
    Code:
                final Player player = e.getEntity();
                Bukkit.getScheduler().runTask(plugin, new Runnable(){
                    public void run()
                    {
                        PacketPlayInClientCommand packet = new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN);
                        ((CraftPlayer)player).getHandle().playerConnection.a(packet);
                    }
                });
    I'd just like an answer as to whether I should go back to using the spigot.jar, or if there's another way to use CraftPlayer and PacketPlayInClient.
     
  2. Offline

    BrickBoy55

    @elian1203 You must use the CraftBukkit/Spigot server jar file to use packets.
     
  3. Offline

    elian1203

  4. Offline

    Scimiguy

    @elian1203
    Mark this thread as solved if solved
     
Thread Status:
Not open for further replies.

Share This Page