[Java Spigot / Minecraft] Is there a way to create a plugin that limits the amount of mobs a spawner can spawn on a server? For example I want to create a mob spawner that automatically stops spawning mobs or destroys itself after spawning 500 mobs.
I already thought about if it is possible, but I didn't know how to track at the mob spawn event, which spawner spawned a mob and how to assign a certain value to this spawner, which determines how many mobs it can spawn.