-1

[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.

  • Hello, welcome to Stack Overflow! Maybe you should [read this](https://stackoverflow.com/help/how-to-ask), and then edit your question. – Diego Borba Aug 11 '23 at 12:49

1 Answers1

0

You can use the CreatureSpawnEvent event, check where the entity was spawned and increment a counter or a dictionary of the spawners on the server and delete the entity if the limit is surpassed. The Spigot docs are here.

kggn
  • 73
  • 1
  • 8