Solved CraftPlayer? and skipping through Death respawn screen

Discussion in 'Plugin Development' started by artish1, Jul 5, 2013.

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

    artish1

    So i've been going through the forums alot and researching on PlayerDeathEvents and how you can just skip through the respawn screen by sending a packet to the player.

    Code:
    Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                            @Override
                            public void run() {
                                Packet205ClientCommand packet = new Packet205ClientCommand();
                                packet.a = 1;
                                ((CraftPlayer) player).getHandle().playerConnection.a(packet);
                            }
                        }, 1L);
    It keeps telling me that CraftPlayer cannot be resolved to a type.
     
  2. Offline

    daboross

    I don't know about PlayerDeathEvent, but I can tell you that you need CraftBukkit as a dependency, not just Bukkit, if you are going to use CraftPlayer.

    If you downloaded Bukkit to use as a dependency, you will need to download CraftBukkit as well when you are using things like CraftPlayer.

    Also, another note, although this will never happen for the regular server, you might want to check that player instanceof CraftPlayer before you cast it.
     
  3. Offline

    xCyanide

    artish1
    What version of craftbukkit are you using? If your craftbukkit version is 1.5.2 you can import it manually.
    This is the import
    Code:java
    1. import org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer;
     
  4. Offline

    artish1

    Woops no wonder, I dont have craftbukkit. Let me just get that real quick and ill get back to you

    EDIT: alright everythings fine now, Looks like just a small problem of mine that i didn't have craftbukkit.
     
  5. Offline

    gamer1097

    I love you you just saved me :)
     
  6. Offline

    xCyanide

Thread Status:
Not open for further replies.

Share This Page