Check if there are mobs alive
#4
OnTick() shouldn't do a ForEach anything, because that could slow the server down considerably.
I think you should wait with this plugin until there's proper mob AI, because then we'll have a full set of hooks for all entity-related needs, such as OnMobSpawning() etc.

Another idea that could work even now is to count all the mobs at one moment with ForEachEntity(), then subtract one from this counter each time a mob is killed (OnTakeDamage() when damage is more than life left). This should give you a pretty accurate picture, providing that mobs don't spawn in the meantime.

Anyway, still there's no way for you to disable mob spawning or to spawn more mobs from a plugin, so, as I said, better wait (and give Keyboard some motivation to do the AI Wink )
Reply
Thanks given by:


Messages In This Thread
Check if there are mobs alive - by tonibm19 - 05-06-2013, 09:28 PM
RE: Check if there are mobs alive - by NiLSPACE - 05-06-2013, 09:30 PM
RE: Check if there are mobs alive - by tonibm19 - 05-06-2013, 09:33 PM
RE: Check if there are mobs alive - by xoft - 05-06-2013, 09:38 PM
RE: Check if there are mobs alive - by NiLSPACE - 05-06-2013, 09:38 PM
RE: Check if there are mobs alive - by tonibm19 - 05-06-2013, 09:42 PM
RE: Check if there are mobs alive - by tonibm19 - 05-07-2013, 12:00 AM
RE: Check if there are mobs alive - by NiLSPACE - 05-06-2013, 09:45 PM
RE: Check if there are mobs alive - by NiLSPACE - 05-07-2013, 12:03 AM
RE: Check if there are mobs alive - by tonibm19 - 05-07-2013, 02:30 AM
RE: Check if there are mobs alive - by NiLSPACE - 05-07-2013, 02:39 AM
RE: Check if there are mobs alive - by xoft - 05-07-2013, 02:41 AM
RE: Check if there are mobs alive - by tonibm19 - 05-07-2013, 04:51 AM
RE: Check if there are mobs alive - by NiLSPACE - 05-07-2013, 05:03 AM
RE: Check if there are mobs alive - by xoft - 05-07-2013, 05:44 AM
RE: Check if there are mobs alive - by tonibm19 - 05-07-2013, 06:36 AM
RE: Check if there are mobs alive - by tonibm19 - 05-08-2013, 05:26 AM
RE: Check if there are mobs alive - by xoft - 05-08-2013, 05:31 AM
RE: Check if there are mobs alive - by tonibm19 - 05-08-2013, 05:34 AM
RE: Check if there are mobs alive - by xoft - 05-08-2013, 06:13 AM
RE: Check if there are mobs alive - by tonibm19 - 05-08-2013, 06:26 AM
RE: Check if there are mobs alive - by xoft - 05-08-2013, 06:30 AM



Users browsing this thread: 10 Guest(s)