#(boryte) Issue with cloning NPCs with citizens.

21 messages · Page 1 of 1 (latest)

vague geyser
#

Error:

[12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 33. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 34. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 35. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 36. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 37. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 38. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 39. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 40. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 41. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 42. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 43. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 44. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 45. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 46..

Code:

        new BukkitRunnable() {
            @Override
            public void run() {
                NPC mainNPC = CitizensAPI.getNPCRegistry().getById(0);
                NPC clonedNPC = mainNPC.clone();
                clonedNPC.setName(ColorUtils.colorize(generateUsername()));
                clonedNPC.spawn(safeLocation);
                clonedNPC.getEntity().setMetadata("PvPBot", new FixedMetadataValue(KitPvP.getInstance(), true));
                clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.HELMET, new ItemMaker(createRandomItem(helmetMaterials, helmetChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
                clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.CHESTPLATE, new ItemMaker(createRandomItem(chestplateMaterials, chestplateChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
                clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.LEGGINGS, new ItemMaker(createRandomItem(leggingsMaterials, leggingsChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
                clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.BOOTS, new ItemMaker(createRandomItem(bootsMaterials, bootsChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
                clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.HAND, new ItemMaker(createRandomItem(handMaterials, handChances)).setEnchant(Enchantment.DAMAGE_ALL, generateRandomEnchantement()).setUnbreakable(true).create());
                SentinelTrait sentinelcloned = clonedNPC.getOrAddTrait(SentinelTrait.class);
                sentinelcloned.reach = MathUtils.Randomizer.generateDouble(3, 3.75);
                sentinelcloned.attackRate = 1;
                sentinelcloned.speed = MathUtils.Randomizer.generateDouble(1, 2);
                sentinelcloned.armor = -1;
                clonedNPC.data().setPersistent(NPC.Metadata.REMOVE_FROM_PLAYERLIST, true);
                clonedNPC.data().setPersistent(NPC.Metadata.NAMEPLATE_VISIBLE, true);
                clonedNPC.data().setPersistent(NPC.Metadata.SHOULD_SAVE, false);
                clonedNPC.data().setPersistent(NPC.Metadata.WATER_SPEED_MODIFIER, 1.1f);
                clonedNPC.data().setPersistent(NPC.Metadata.PATHFINDER_OPEN_DOORS, true);
                clonedNPC.data().setPersistent(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION, true);
                spawnedBots++;

                if (spawnedBots >= spawnedCount) {
                    spawnedBots = 0;
                    cancel();
                }
            }
        }.runTaskLater(plugin, 20L * spawnedBots);

    }```
slate nexusBOT
#

(boryte) Issue with cloning NPCs with citizens.

slate nexusBOT
#

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.

wanton robin
#

!logs

worthy dirgeBOT
# wanton robin !logs
Info: logs

Please post your full latest log file.

Background Info: One of the most helpful tools to identifying the source of a problem is your server logs file! Logs contain all sorts of important information like server and plugin versions, any error messages, and a lot more important information (More Info).

How To: Your log can be found in the logs folder within your server folder. The most recent log is a text file labeled latest.log. To get help using these logs, please open that file in a text editor and copy all of the text, then open https://paste.denizenscript.com/New/Log and paste the text into the box on the page. Then click "Submit" and copy the URL and paste that back into this channel.

Please do not upload the file to Discord or to other pastebin services, use the log pastebin linked above.

wanton robin
#

and post saves.yml please

#

@vague geyser

wanton robin
worthy dirgeBOT
# wanton robin !logcheck https://paste.denizenscript.com/View/121924
Server Version

Purpur version git-Purpur-2169 (MC: 1.20.4)

Plugin Version(s)

Citizens v2.0.33-SNAPSHOT (build 3382) -- (Current build :white_check_mark:)
Sentinel v2.8.1-SNAPSHOT (build 518) -- (Current build :white_check_mark:)

Checked For

@wanton robin

Online/Offline

Offline (proxy likely).

UUID Version

4 (:white_check_mark: Online)

Java Version

17.0.10 :white_check_mark:

Other Noteworthy Plugin(s)

ProtocolLib v5.2.0-SNAPSHOT-679

Problematic Plugin(s)

PlugManX v2.3.7 - :warning: Plugin Managers are dangerous and will cause unpredictable issues. Remove it.

Possibly Relevant Plugin(s)

ViaVersion v4.9.4-SNAPSHOT - Mixed client vs server versions can sometimes cause packet-related issues.
FastAsyncWorldEdit v2.9.1-SNAPSHOT-660;f94b96d - This plugin has been known to break the plugin load order on many servers, due to usage of the 'loadbefore' directive in its 'plugin.yml'.

Potentially Bad Line(s)

Starting Minecraft server on 0.0.0.0:29999 - server is offline but has no address bind. This might mean you're using a system level firewall, but if not, it means your proxy is bypassable by hackers. Either enable a system level firewall, or bind your server to localhost in server.properties via server-ip=127.0.0.1.
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key :warning: Log contains error messages.

wanton robin
worthy dirgeBOT
wanton robin
#

@vague geyser is it possible to reduce this to a simple testable case?

#

especially without Sentinel?

#

clone() saves then loads the NPC, so that is where I need to start

slow jettyBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@vague geyser