Make entity dissapear and then reappear

Discussion in 'Plugin Development' started by iBecameALoaf, Dec 14, 2014.

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

    iBecameALoaf

    Is there any way that I can make a snowball appear again, after dissapearing. Here's the code i'm using:

    Code:
    for (Player player : Bukkit.getOnlinePlayers()) {
    
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(((CraftSnowball) s).getHandle().getId()));
            }
    
    All I need to do now is make it reappear, any idea how?
     
  2. @iBecameALoaf
    Let's start with this: why are you using packets?
     
  3. Offline

    iBecameALoaf

    Because there is no other way to make a snowball invisible without using packets :/
     
  4. @iBecameALoaf
    But your code destroys the entity. Would be same as just calling Entity#remove. If you want to make them invisible, use ProtocolLib.
     
  5. Offline

    iBecameALoaf

    I remember making the snowball invisible without destroying it one time, but I can't remember the packet name. I believe it was something close to PacketPlayOutEntity (idk), but I'm pretty sure there is a packet to just make it invisible, and not destroy. I can't seem to find it on this list https://docs.google.com/spreadsheet...aU1RZUswZ2dqUFRpTTkyUEk1dXc&usp=sharing#gid=0

    EDIT: Turns out that was the packet, is there any way to do this without protocallib?
     
    Last edited: Dec 14, 2014
  6. Offline

    MisterErwin

  7. Offline

    iBecameALoaf

Thread Status:
Not open for further replies.

Share This Page