Solved [Packets] Sending a packet to display an entity effect

Discussion in 'Plugin Development' started by d3v1n302418, Sep 19, 2014.

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

    d3v1n302418

    FINAL EDIT: Okay, solved it on my own. :D Just took an hour of research.
    Final Code:
    Code:
                EntityPlayer nmsPlayer = ((CraftPlayer) p).getHandle();
                int x, y, z;
                x = p.getLocation().getBlockX();
                y = p.getLocation().getBlockY()-1;
                z = p.getLocation().getBlockZ();
                PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles("smoke", x, y, z, 1, 1, 1, 0, 15);
                nmsPlayer.playerConnection.sendPacket(packet);
     
  2. Offline

    Da_Co0k1eZ

    I don't quite know what's wrong with your code, but whenever I do packets, I create a EntityPlayer object directly instead of a CraftPlayer in-between.
    Code:java
    1. EntityPlayer nmsPlayer = ((CraftPlayer) pl).getHandle();
    2. nmsPlayer.playerConnection.sendPacket(packedt);

    This is usually how I do it.
     
  3. Offline

    d3v1n302418

    Da_Co0k1eZ Hey, thanks for the reply -- I realize my way is a little noobish, but it works, which makes me happy. :p Your method is better so thank you.
     
  4. Offline

    xize

    I don't know much about this but could it be that you need to use:

    craftplayer.playerConnection().a(packet)

    also from older nms versions I know there was a seperated thing for effects with the enum class MobEffect and a sort of void method you need to use although I'm not 100% sure about that, maybe that has nothing todo with sending packets.

    however what could help you is searching in the main nms class for a wolf this class is called EntityWolf or something smilliar, you can find it on mc-dev Im definetly sure you can find it there.

    Edit nvm, phone typing is slow:p
     
Thread Status:
Not open for further replies.

Share This Page