Mob Spawn Control
Mob Spawn Control allows you to take control of the XP grinders (experience grinders, mob farms) on your server. Our server had a problem with XP grinders bringing the server to its knees. I created this plugin to limit the number of monsters (mobs) that could pop out of a given spawner. Once the spawner is maxed it will prevent further monster spawns until a monster is killed. Once the monster is killed it is decremented from the list. Basically the plugin keeps track of active/alive monsters attached to a spawner.
Feature List
- Limit monsters spawned from a single spawner
- Report on top spawners currently on the server
- Assigns spawner to a player in the report
- Teleport to a given spawner for investigation
- In-game debugging option
- In-game enable/disable option
- In-game stat reset
- In-game configuration reload
Why Should I use MSC?
There are many different plugins that handle mob spawners. I've reviewed each of them and they all have their advantages. Rather than tell you "MSC is the best" I will give you a break-down of the problem each plugin resolves. I fully support the other plugins in the community which is why I've linked them below. You decide which is best for your scenario.
My thoughts on other Mob Spawner control plugins can be found HERE.
Commands
All commands can be accessed by typing /msc or /mobspawncontrol followed by the following subcommands:
- HELP = shows the help menu
- STATS = shows the current spawner stats
- TP = teleports to a given spawner in the stats report
- RESETSTATS = reset all current stats on the server
- DEBUG = enabled debugging mode in the console (Lots of spam here!)
- RELOAD = reload the config from disk
- TOGGLE = toggles the plugin on and off in real time
Permissions
- msc.*: Gives access to all MobSpawnControl features
- msc.command: Allows player access to MSC commands
- msc.stats: Allows players access to STATS command
- msc.tp: Allows players access to TP command
- msc.resetstats: Allows players access to RESETSTATS command
- msc.debug: Enables MSC debugging
- msc.reload: Reloads config from disk
- msc.toggle: Toggles the plugin on and off in real time
Config Options
- spawnsAllowed:
- reportSize:
- pluginEnable:
- debug:
- oneTimeUse:
- warnThreshold:
- alertThreshold:
- spawnerRadiusX:
- spawnerRadiusY:
- spawnerRadiusZ:
- playerDistance:
Detailed config descriptions can be found HERE.
Source
Source can be found HERE.
@Cosx
I'm unable to recreate the problem you listed below. I actually thought of that scenario and coded for it. Mobs despawn immediately if there is not a player within 128 blocks of it so logging out will make all monsters vanish (and subsequently be removed from the stats). If another player stays close by while the first player logs out it will still keep all the monsters in the list because they haven't despawned. But this is intentional as we want the monsters in the list as long as they're alive.
The only time someone shows up in a list twice is if they have two spawners attached to them. Each list item is tied to a unique spawner so there isnt a way for the scenario you described to happen without multiple spawners.
Now there is a scenario where the STATS will show a "ghost" number. I call it a "ghost number" because its technically the number of monsters that were tied to this spawner when the last person logged out. Let me explain how this works...
I felt this was a good tradeoff to keep the plugin from constantly polling spawners for an accurate number. After all the intention of the plugin is to prevent lag, not increase it :)
Hello I have been running this plugin since last night, and I have noticed a few things.
The limiting of the mob spawns works fine, but if a player logs out then back in their /msc stats will create a new entry, and they will be able to spawn up to the default amount again.
So for example, - I am sitting at a spawner, and default spawn limit is 10. - 10 Mobs are stuck in my trap. - I log out, then back in again. - 10 More mobs will spawn, for a combined total of 20 mobs stuck in my trap.
Now this isn't a huge issue, as the plugin still prevents players from going afk at a mob trap, but if you have a player whose sole purpose is to try and lag the server, this doesn't seem to prevent it.
I am not really sure how you could prevent this, but I thought I would mention it.
Plugin works great otherwise, and was definitely needed on my server, as multiple people would go afk at their mob trap and let 100's of mobs spawn, lagging my relatively small server.
Verified the jar was indeed compiled with java 6 and re-uploaded. If you are running Java 6 you will want to download 2.4.1
FYI... The updated file is waiting on bukkit approval. If you download the current version you will only have spawnsAllowed & reportSize available. 2.4 is the version everyone should be using... as soon as bukkit approves it :)
UPDATE: 2.4 is now available for download.
@XxTRAINEExX
Thank you! :P This plugin will make my server AMAZING, Mob farms really do ruin RPG and Economy servers, I hate it so much.
@ryanwagner
Can you post a ticket with the enhancement you are asking for? If it sounds cool I will build it. I think I understand what you are asking but I don't want to guess :)
@XxTRAINEExX
I want to restrict it further so that mob spawning has a cost associated with it. In this case the cost of item consumption when you add the charges
@TnTBass
I just ran multiverse in my DEV environment and it worked fine with MSC. I did have to pull down a development version of multiverse as their current live build isn't compatible with bukkit 1.2.5.
@xclucky
Wel I'm not tech support but I can offer some general advice :) I found an article for Ubuntu here: https://help.ubuntu.com/community/Java
There is a section that outlines the installation process for 1.7 since .deb files are not available yet.
BTW.. The new 1.6 version is live on dev.bukkit. Enjoy.
@ryanwagner
Not sure why you need the charges. The current plugin allows for 'x' number of monster spawns from a given spawner; determined by spawnsAllowed in the config file. This number represents the number of ALIVE monsters allowed for that spawner. If a player kills a mob it will decrement the list of ALIVE monsters for that spawner. This will allow the spawner to spawn another mob.
Also, you can modify the default (80) to be anything you want. Remember this number signifies ALIVE monsters attached to one specific spawner. Each spawner has its own list.
Is there something else you are trying to achieve with charges?
@XxTRAINEExX
Thank you very much. I wonder if GeekSquad can update my Java to Java 7 because I get an error code every time I do it :/ Very annoying, I also have 32-bit os and 32-bit Java, that annoys me too because I have 16gb ram... sigh... my PHP server is also broken...
I don't see a source link, but I had a thought about how to control "charges".
When the block is placed, or updated, it is added by XYZ cords to a flatfile. When a mob is spawned it is checked against the flatfile where charge information is stored. if no charge is available then the spawn is removed/canceled.
Additionally players who hit the block with the charge item the item is consumed and the flatfile is updated with +1 charge.
This would make it possible, but I guess it would depend on how he code currently looks.
@mumblerit
I agree with squatingyeti: I would check with nolagg examiner. On our server this plugin is in the bottom 10% of lag contribution.
@TnTBass
Holy moly thats a lot of errors... Appears to be specifically related to "MultiverseCore". multiverse core is throwing "java.io.EOFException" which means java unexpectedly hit the "End of a file" it was reading/writing.
I can't say my plugin has anything to do with that but there's a chance I may be extending a method they rely on... causing an unexpected result. I will throw multiverse on my dev machine and see what happens.
In the meantime, can you verify you DO NOT RECEIVE errors when MobSpawnControl is removed from your plugins directory? Then place the plugin and see which errors pop up. Just want to make sure you aren't giving me more work for nothing :)
@xclucky
Looks like you are running an old version of java. That error "Unsupported major.minor version 51.0" means the java you are running is older than the version I used to compile the JAR.
Java 7 is available for linux as we use it on our server. I will upload a 1.6 version shortly for everyone still on Java 6.
UPDATE I just uploaded a Java 6 version to bukkit.dev. As soon as they approve it you can download.
I get this error using the plugin:
http://pastebin.com/hZctC8iv
I remove the plugin and the error goes away. Can you please make this Multi world compatible? I use Multiverse for my multiple worlds.
It doesn't work for me :( and I DESPERATELY need this plugin. I've been searching for exactly this for months. Thank you so much for making it.
10:57:55 [SEVERE] Could not load 'plugins/mobspawncontrol.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: net/yeticraft/xxtraineexx/mobspawncontrol/MobSpawnControl : Unsupported major.minor version 51.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:150)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:213)
at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:189)
at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:53)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:157)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:423)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Caused by: java.lang.UnsupportedClassVersionError: net/yeticraft/xxtraineexx/mobspawncontrol/MobSpawnControl : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139)
... 8 more
I'm using CraftBukkit version git-Bukkit-1.2.5-R1.3-13-g7ab0391-b2190jnks (MC: 1.2.5) (Implementing API version 1.2.5-R2.0)
I'm also operating off Linux Ubuntu 11.04 with Java 6 (I do not believe Java 7 is available for Linux yet)
seems fantastic plugin!
Doubt the plugin is any source of your lag as it actually reduces lag by limiting the number of mobs stuck in a 1x1 space from players' xp grinders. We have been running it on our server without issue for a bit before it was released publicly. Have you tried something like a nolagg examine to see what might be causing the issue? Other than that, source is on github. If you notice an issue, post again, but try a nolagg examine report as well so you can show what in the plugin could be causing any lag on your end.
@XxTRAINEExX
seeing some minor lag, havent traced it back to your plugin yet, perhaps some source to peruse?