1.15.2 EntityArmorStand doesn't work

Discussion in 'Spigot Plugin Development' started by MarcusSlover, Feb 10, 2020.

  1. Hi all, can somebody help me? I have no idea why isn't this working!
    I'm trying to spawn an armor stand with packets for a certain player, but the armor stand is just an armor stand without the options I set. He isn't invisible as I set it, and doesn't have the name I specified!
    Can someone help me?

    Code (Java):

    EntityArmorStand entityArmorStand = getHologramLine(loc, this.getLine(i));
                PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(entityArmorStand);
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);


    //The method
    private EntityArmorStand getHologramLine(final Location loc, final String value) {
            WorldServer worldServer = ((CraftWorld) this.location.getWorld()).getHandle();
            EntityArmorStand entityArmorStand = new EntityArmorStand(EntityTypes.ARMOR_STAND, worldServer);

            entityArmorStand.setSilent(true);
            entityArmorStand.setMarker(false);
            entityArmorStand.setNoGravity(true);
            entityArmorStand.setSmall(true);
            entityArmorStand.setInvisible(true);
            entityArmorStand.setCustomNameVisible(true);
            entityArmorStand.setCustomName(IChatBaseComponent.ChatSerializer.a("{\"text\":\""+ getColor(value) +"\"}"));
            entityArmorStand.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());

            return entityArmorStand;
        }
    Thanks,
    Marcus
     
  2. This is what's happening, there is no errors in console and here:
    upload_2020-2-10_18-11-49.png
     
  3. Replace with SpawnEntity & send Metadata packet (using ArmorStand#getDataWatcher())
     
  4. What is that mean
     
  5. You only sent out the SpawnEntityLiving-Packet. You also habe to send out the EntityMetadata-packet (I don‘t know what it‘s called exactly, prolly something like PacketPlayOutEntityMetadata)
     
  6. Anyone have a solution?