NoGrind
NoGrind
A customizable mob farm remover.
Are you running a server with an economy? Sick of your players HAVING to have a mob spawner just to keep up with the jonses? This plugin removes all mob drops unless players themselves use a sword or a projectile to kill a mob.
Unlike other plugins that accomplish this, this plugin doesn't just track the last hit, and doesn't stop music discs from dropping.
How it works:
When players hit a creature with a sword, or with a projectile, the plugin tags and tracks the entity that was hit for a period of time, which is configurable by the server host (via the config file). If the mob dies within this window of time, it will drop items and experience normally. If the mob is not tagged and tracked by the plugin as being hit, it will drop nothing.
Why did I make this?
The server I work for has been using another anti mob farm plugin for some time. We had the following annoyances with it, all of which, my plugin addresses:
- Mobs killed by Flaming Aspect damage immediately after a strike would not yield drops.
- Some did not allow drops from kills with arrows.
- Some did not distinguish between kills with arrows from players, mobs, dispensors.
- Mobs killed by fall damage after a knockback would not yield drops.
Since each of these required a duration-based combat tagging system, I decided that it would be best to write my own, this made it quite a departure from how our previous plugin worked. This addressed each of our issues with it, so we decided to use it on our server before dispenser-farms became a problem. Since we were using it for our server, and it only took about half an hour to write, I figured I would share it with bukkit.
This sounds inefficient, you say?
I can assure you that this is highly efficient. Combat tags are sorted into a single queue, and only a single Asynchronous event is running at a time, no matter how many mobs are in the queue. The queue itself will not overflow, and cleans itself up in the order that mobs were struck. If a mob is removed prematurely, the plugin will be able to carry on happily as though nothing happened.
The timer system will not take up much memory, nor will it take up much CPU at all. This is a very lightweight method of handling this. Though it isn't as simplistic or lightweight as other plugins that do the same thing, the difference in performance is negligible, while the benefits of NoGrind are clear.
Regrettably, there are known bugs:
- Monsters damaged by potions will not be combat tagged. This is a bukkit bug.
Future Additions:
I will be writing two optional modules for this plugin.
Module #1: Will allow server administrators to change what mobs drop, and the likelihood of the items dropping through customization of loot tables on a per-monster, per world basis.
Module #2: Will interface with economy plugins to permit mobs to drop money, or to give money directly to the player.
I will be writing several configurable options for this plugin:
- Options to configure the amount of experience you get from each mob, modifiers for worlds, etc.
- Experience per hit instead of on death (Optional)
- Experience given to player directly, instead of dropped (Optional)
Source code
Source is available on github and bukkit.
@GarretSidzaka
Garret, you are talking about a mob trap, and not a mob farm/grinder. There is an easy way around the mob trap/grinder, and Jadedwolf's upcoming update will probably fix that, given that he is going to be giving exp based on damage.
I'm going to be working out an additional preference to mine as well, that will allow server admins to set mob spawners to remove the chance to drop items/exp outright from anything they spawn. (MoneyDrop already has this option as well).
There will also be another method of dealing with mob traps within my plugin via configurations. At some point, when I uncrash my desktop's HDD, and get back to programming (YAY! HDD failure!), an option will be added for damage tracking, and giving exp per-hit, rather than per-kill. This will of course, make things a bit easier for what you are attempting to remove in your server.
@GarretSidzaka
All that I and @TerXIII respectively of course. We are trying to stop automation. The automated grinders and mob farms that require zero effort on the players part, other then to just stand there. The other main purpose is to keep these automated contraptions from spewing items in a pile without regard to server lag or lag of players around. So respectively NoFarm and NoGrinds main purpose is to stop automation to prevent lag. :)
the most annoying and sophisticated mob grinder i ever had the privilege of removing from my server, would have defeated your protection.
his mobgrinder was a no-kill mob grinder that safely brought the mobs to a central "training room" where the mobs could easily be killed in a small water zone by the players. this not only allowed them to grind drops, but they also RUINED the McMMO stats (i removed that plugin)
what im saying is the worst grinders might not autokill is what im saying
@Jadedwolfs
We do, as a group, have to thank you for your plugin. It worked marvelously for months for our server. We have just outgrown its usage, and the 0.3 update actually rendered it useless to our server, given the fact that dispenser farming was now possible.
Since you didn't release the source of your mod, I opted to write my own. A good thing too, as had I decompiled your mod and changed it, from the sound of things, you would not have cared for that either. As you say, we wrote this one for our server, but we also figured others would appreciate a more flexible, open-source variety.
Take a look at the source of this one. It might look like a complicated mess, but it's really quite minimal in server footprint, certainly not by comparison to your initial release for NoFarm, but even so, it should never use more than a small bit of memory, or CPU, as the timer system implemented is the most efficient timer-based queue possible. (It sacrifices precision for efficiency)
I neglected any reference to NoFarm in my post, except indirectly, as to avoid seeming as though I was targeting your mod's audience. Honestly, though, it seems like the community has done that for me, and all I can really say, is that I wish you the best with your plans for NoFarm, but this is where you and I diverge in direction for our respective plugins.
@TerXIII
The reason I did not use your suggestions were based on efficiency and simplicity. My plugin could be considered too simple. The whole plugin uses less then 100 lines of code. Not to mention has zero hooks into permissions or anything else. Thus why adding your suggestions would increase the foot print my plugin adds to servers. I like the fact my plugin is simple and to the point, no frills and whistles and has an uber tiny foot print on servers. I'm all about plugins that use little to no resources. NoFarm was created for me, I only made it public because others might want to use it. NOTE: My plugin will soon deal with XPorbs. XP will drop based on how much damage a player does to thus mob, so if the player does half the damage to the mob it will only drop half the xp, if the player does 100% of the damage the player will get 100% of the xp and all the variations.
@godgodgodgo
You are incorrect. NoFarm never fixed any of the problems in my list. When NoFarm was updated to 0.3, arrows AND Dispensers registered as a player kill. This is because NoFarm was checking to see if the player caused the damage in the wrong way. I informed JadedWolf of this, and told him how to fix it.
Again, these are the problems with NoFarm v0.3 (The latest update, all of these and more are addressed by my plugin. Also, my plugin deals with EXP in addition to Items. NoFarm doesn't deal with EXP.): Mobs killed by Flaming Aspect damage immediately after a strike would not yield drops. Some did not distinguish between kills with arrows from players, mobs, dispensors. Mobs killed by fall damage after a knockback would not yield drops.
NoFarm just got an update to fix all those problems though I think XD
Kudos!