EntityEffect not working correctly

Discussion in 'Plugin Development' started by leimekiller, May 8, 2014.

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

    leimekiller

    Hello guys,

    So I am trying to add potion effects without particles. I tried this:

    Code:java
    1. private void addPotionEffect(Player player, PotionEffect pe)
    2. {
    3. PacketPlayOutEntityEffect packet = new PacketPlayOutEntityEffect(player.getEntityId(), new MobEffect(pe.getType().getId(), pe.getDuration(), pe.getAmplifier()));
    4.  
    5. ((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
    6. }


    It does add the potion effect image in the inventory menu with the right effect, time and amplifier. But it does not change the movement speed (If speed potion effect is given). Does anyone know how to fix this?
     
  2. Offline

    Aqua

    Packets only tell the client what to display.
    The actual effect is handled by the server, so you need to manualy change speed.
     
Thread Status:
Not open for further replies.

Share This Page