#(EternalHuman) Name bug with API

16 messages · Page 1 of 1 (latest)

dawn mural
#

Latest build
Minecraft 1.12.2 (Paper)

    HologramTrait trait = npc.getOrAddTrait(HologramTrait.class);
    trait.addLine(customNPCType.getName());
    npc.spawn(location);
    npc.data().setPersistent(NPC.Metadata.NAMEPLATE_VISIBLE, false);

When I connect to the server first, all nicknames are hidden. But when the second and more player connects, all the original NPC nicknames appear and there is no way to hide them (even with the /npc name command).

uneven hearthBOT
#

(EternalHuman) Name bug with

uneven hearthBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

dawn mural
#

0 errors in console, no plugins that can affect on scoreboard teams

#

(EternalHuman) Name bug with API

#

I can fix it only using this code:

ON CREATE NPC:
new SyncTask(() -> {
Team team = Util.getDummyScoreboard().getTeam(npc.getName());
if (team == null) {
team = Util.getDummyScoreboard().registerNewTeam(npc.getName());
}
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
if (!team.hasEntry(npc.getName())) {
team.addEntry(npc.getName());
}
this.team = team;
new AsyncRepeatTask("20", () -> {
if (!getTeam().hasEntry(npc.getName())) {
getTeam().addEntry(npc.getName());
}
}, 3);
}, 2);

ON PLAYER JOIN

new AsyncTask(() -> {
CustomNPC.getCustomNpcList().forEach(customNPC -> {
if (customNPC.getTeam() == null) return;
NMS.sendTeamPacket(getPlayer(), customNPC.getTeam(), 0);
});
}, 10);

#

Additional information: i have many NPCs with similar names

dawn mural
#

When second player joins npc just disappears from team.getEntries()