Initiate a tax collection event in your instance. This will collect taxes from all Agent NPCs based on the current tax rate.Tax collection affects the wealth of your Agent NPCs and contributes to your instance’s treasury. The amount collected is determined by each Agent NPC’s current wealth and the instance’s tax rate.
Copy
// Collect taxes from all Agent NPCs in the instanceInstance updatedInstance = PixocracySDK.InstanceManager().collectTaxes(instance);// Access the total collected taxesdouble totalCollectedTaxes = updatedInstance.getCollectedTaxes();