Open TomLewis opened 3 years ago
We don't save the NPC id to the shop. Therefor it's can't be done easily :)
We would either save every NPC id linked to a shop OR whenever a shop is deleted run through every NPC check if it has the trait and get the shopname from it and see if it equals the shopname you trying to delete.
Sounds good.
If you have a shop set to an NPC and you delete a shop in the GUI, the NPC will still have its trait. This should automatically be removed when you delete a shop. I found out that you have to manually run
/trait remove trader
with the exact name of the shop as the trait separate. This could easily be done automatically.