1.15.2 Shulker custom name doesn't show up

Discussion in 'Spigot Plugin Development' started by bertek41, Feb 11, 2020.

Thread Status:
Not open for further replies.
  1. Everything works but i can't see name and no errors in console.

    Code (Java):
    final EntityShulker shulker = new EntityShulker(EntityTypes.SHULKER, ((CraftPlayer)player).getHandle().world);
    shulker.setPosition(loc.getBlockX() + 0.5, loc.getBlockY(), loc.getBlockZ() + 0.5);
    shulker.setFlag(6, true);
    shulker.setFlag(5, true);
    shulker.setInvulnerable(true);
    shulker.setNoAI(true);
    shulker.setSilent(true);
    shulker.setCustomName(CraftChatMessage.fromStringOrNull("test"));
    shulker.setCustomNameVisible(true);

    PacketPlayOutSpawnEntityLiving spawnEntityLiving = new PacketPlayOutSpawnEntityLiving(shulker);
    ReflectionUtils.sendPacket(player, spawnEntityLiving);

    PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata(shulker.getId(), shulker.getDataWatcher(), true);
    ReflectionUtils.sendPacket(player, metaPacket);
     
  2. Code (Java):

    final EntityShulker shulker = new EntityShulker(EntityTypes.SHULKER, ((CraftPlayer)player).getHandle().world);
    shulker.setPosition(loc.getBlockX() + 0.5, loc.getBlockY(), loc.getBlockZ() + 0.5);
    shulker.setFlag(6, true);
    shulker.setFlag(5, true);     // <-- invisible and custom name at the same time not possible
    shulker.setInvulnerable(true);
    shulker.setNoAI(true);
    shulker.setSilent(true);
    shulker.setCustomName(CraftChatMessage.fromStringOrNull("test"));
    shulker.setCustomNameVisible(true);

    PacketPlayOutSpawnEntityLiving spawnEntityLiving = new PacketPlayOutSpawnEntityLiving(shulker);
    ReflectionUtils.sendPacket(player, spawnEntityLiving);

    PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata(shulker.getId(), shulker.getDataWatcher(), true);
    ReflectionUtils.sendPacket(player, metaPacket);
     
     
  3. Its possible for ArmorStand. Are you sure thats the problem?
     
    #3 bertek41, Feb 12, 2020
    Last edited: Feb 13, 2020
  4. I tried spawning one that was visible and the name-tag showed up as expected
     
  5. Okay then thanks for helping
     
Thread Status:
Not open for further replies.