Solved Another packet problem - adding potion effect

Discussion in 'Plugin Development' started by TJM4, Oct 15, 2015.

Thread Status:
Not open for further replies.
  1. Hi all,

    So I have been having some problems with packets recently. I am trying to make an armour stand invisible so you can only see the bedrock on its head but its just not going invisible... I think I have got the correct packet name.

    Code:
        public void spawn(Location loc, Player p, Material m) {
            WorldServer s = ((CraftWorld)loc.getWorld()).getHandle();
            EntityArmorStand stand = new EntityArmorStand(s);
          
            stand.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
            stand.setGravity(true);
           
               
           
            PacketPlayOutSpawnEntityLiving spawnP = new PacketPlayOutSpawnEntityLiving((EntityLiving) stand);
           
            PacketPlayOutEntityEquipment EquipP = new PacketPlayOutEntityEquipment(stand.getId(), 4, CraftItemStack.asNMSCopy(new ItemStack(Material.BEDROCK)));
            PacketPlayOutEntityEffect effect = new PacketPlayOutEntityEffect(stand.getId(), new MobEffect(14, 1000, 1, true, true));
           
            sendPaket(p, spawnP);
            sendPaket(p, EquipP);
            sendPaket(p, effect);
           
            }
        @SuppressWarnings("rawtypes")
        public void sendPaket(Player p, net.minecraft.server.v1_8_R2.Packet pa) {
            ((CraftPlayer)p).getHandle().playerConnection.sendPacket(pa);
        }
    Hope someone can help

    TJM4
     
  2. What about spawning a normal armor stand and setting the Invisible:1 tag?
     
  3. @FisheyLP Wow thanks completly forgott about that tag :D
     
Thread Status:
Not open for further replies.

Share This Page