My guess is you are trying to use Main.rand in SetDefaults, which is a bad idea. Also, come to discord, you'll get live help there: discord.me/tModloaderHey there, long time no see! So, I've got a problem: When I try to insert code into the SetDefaults(NPC npc) override on a GlobalNPC class, it breaks mods like Calamity and Tremor giving me this message:
Object reference not defined for an instance of an object.
in Dmode.DModeNPC.SetDefaults(NPC npc)
in Terraria.ModLoader.NPCLoader.SetDefaults(NPC npc, Boolean createModNPC)
in Terraria.ModLoader.ModLoader.doLoad(Object threadContext)
Details: This showed up from nowhere, before, I was able to run both mods together with no problems.
And this one also shows up when I use any kind of user interface.