use of net.citizensnpcs.api.event.NPCCloneEvent in project CitizensAPI by CitizensDev.
the class AbstractNPC method copy.
@Override
public NPC copy() {
NPC copy = registry.createNPC(getOrAddTrait(MobType.class).getType(), getFullName());
DataKey key = new MemoryDataKey();
save(key);
copy.load(key);
for (Trait trait : copy.getTraits()) {
trait.onCopy();
}
Bukkit.getPluginManager().callEvent(new NPCCloneEvent(this, copy));
return copy;
}
Aggregations