Giter Site home page Giter Site logo

moblimiter's Introduction

MobLimiter

Version 2 of MobLimiter, featuring three configurable Limiter engines that control the mob population in different ways.

While the original version of MobLimiter was primarily designed to cull mobs on chunk unload, with limited support to prevent new spawns in real time, MobLimiter 2 is designed from the ground up to be more proactive about managing the spawning and removal of entities. The Limiters are:

  • Age: Mobs can be configured to have a maximum lifespan (in ticks) that results in the entity being killed and dropping its items after the limit is reached. ("Special" mobs are exempt.) MobLimiter will try to not kill breeding pairs of farm animals if it can, by not killing farm animals if there would be less than two in the chunk.

  • Spawning: MobLimiter can be configured to limit the spawning of new mobs in real time, checking the number of the applicable mob type in a "view distance" (as a chunk radius) as well as in an individual chunk and blocking the addition of extra mobs beyond the limit.

  • Chunk Unload: The chunk-unload culling feature of MobLimiter 1.x is still available, if its use is desired.

Configuration

General Settings

  • radius: The "view distance" to check for mobs, as a chunk radius (e.g. 3 would be a 7x7 area)
  • breeding_ticks: Farm animal breeding cooldown in ticks (-1 to disable)
  • growth_ticks: Ticks for a farm animal to grow up (-1 to disable)
  • logblock: Enable LogBlock support. More below.
  • debug: Print debugging info to console

Default Limits

The defaults block defines limits that will globally apply to any mob type that doesn't have an explicit override defined in the limits block. (Undefined values fall back to -1, for disabled.) Specific mob limits inherit the default block, with any defined fields overriding the value from defaults.

defaults:
  age: 18000 #15 minutes in ticks
  max: 200 #200 in "view distance"
  chunk_max: 50 #50 in a single chunk
  cull: 4 #cull mobs down to this maximum on chunk unload
  • age: Enable age limiting and remove the mob after a number of ticks. (e.g. 18000 for 15 minutes)
  • max: The maximum number of a mob type to be allowed to spawn in a "view distance" defined by radius.
  • chunk_max: The maximum number of a mob type to be allowed to spawn in a single chunk.
  • cull: If set to a value other than -1, the number of mobs to not be removed on chunk unload.

Individual Mob Limits

The limits block allows you to specify limits that apply to individual mob types. These inherit the values defined in defaults, overriding the values.

Mob types are named using their Bukkit EntityType string, with the exception of sheep, which are addressed in the form of sheep_white or sheep_red so they can be handled individually for farming purposes.

limits:
  skeleton:
    max: 100
    chunkMax: 30
    age: 12000
  cow:
    chunkMax: 75
    age: 12000
  horse:
    age: -1
  villager:
    max: 200
    chunkMax: 50
    age: -1

Farm Animal Breeding Tweaks

The breeding_ticks and growth_ticks fields define how many ticks a farm animal will remain a baby and the breeding cooldown, respectively. If your server is running at a full 20 ticks per second, a value of 400 for each would make the respective values approximately 20 seconds.

If the value is set to zero, there will be no delay and the condition will be instantaneous. A value of -1 will disable tampering with vanilla breeding behavior.

This function only affects farm animals, and ignores other breedable entities like ocelots, wolves and villagers.

Special Mobs

MobLimiter will not remove any mobs that are deemed to be "special" in some way that may make their removal undesirable.

The criteria include:

  • Mobs with custom names, such as from a name tag

  • Tamed mobs

  • Elder guardians. (Regular guardians can be limited, but Elder ones won't be touched.)

  • Any mob that is holding an item, as it may have picked up a player's equipment.

LogBlock Integration

If LogBlock is running on the server, you can enable LogBlock integration by setting the logblock field to true in the config file. When enabled, mob removals will be tracked as kills in LogBlock when MobLimiter performs a chunk unload cull or age limit kill.

Age limit kills are logged with a weapon of watch and chunk unload culling uses gold sword, both using a "player" name of MobLimiter.

Commands

  • /moblimiter — Lists all subcommands. Available to all users.

  • /moblimiter help — Prints a description of what MobLimiter does. Available to all users.

  • /moblimiter reload — Reload the plugin configuration. Requires moblimiter.reload.

  • /moblimiter count — Count all living entities in your chunk and view radius. Requires moblimiter.count.

  • /moblimiter limits — Print all configured limits. Requires moblimiter.limits.

  • /moblimiter check — Inspect the mob you're looking at, printing its age, limits and statuses. Requires moblimiter.check.

All commands can be accessed with the moblimiter.* permission node.

moblimiter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moblimiter's Issues

Compatibility patch with 1.4.7 R1.0?

While the server is running, there is a stream of errors:

13:01:07 [SEVERE] Could not pass event ChunkUnloadEvent to MobLimiter v1.0
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35)
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
    at net.minecraft.server.v1_4_R1.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:295)
    at net.minecraft.server.v1_4_R1.WorldServer.doTick(WorldServer.java:161)
    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:572)
    at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
    at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
    at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
    at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.NoSuchMethodError: net.minecraft.server.v1_4_R1.Entity.getBukkitEntity()Lorg/bukkit/entity/Entity;
    at nu.nerd.moblimiter.MobLimiter.removeMobs(MobLimiter.java:90)
    at nu.nerd.moblimiter.MobLimiter.onChunkUnload(MobLimiter.java:55)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
    ... 11 more

And on server stop there’s this:

13:03:56 [INFO] [MobLimiter] Disabling MobLimiter v1.0
13:03:56 [SEVERE] Error occurred while disabling MobLimiter v1.0 (Is it up to date?)
java.lang.NoSuchMethodError: net.minecraft.server.v1_4_R1.Entity.getBukkitEntity()Lorg/bukkit/entity/Entity;
    at nu.nerd.moblimiter.MobLimiter.removeMobs(MobLimiter.java:90)
    at nu.nerd.moblimiter.MobLimiter.onDisable(MobLimiter.java:49)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:219)
    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:481)
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:400)
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:393)
    at org.bukkit.craftbukkit.v1_4_R1.CraftServer.disablePlugins(CraftServer.java:277)
    at net.minecraft.server.v1_4_R1.MinecraftServer.stop(MinecraftServer.java:351)
    at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:458)
    at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)

[Enhancement] MobStack support

MobStack is a plugin that stacks mobs to prevent lag from entity cramming/AI calculations. It's essential on my server to prevent mob grinders from lagging the server. I would love to see support between this plugin and that one, as currently this plugin reads the stacked mob as a single mob, rather than the stack size (say there's 5 stacks of 30 mobs, I would like to prevent any more mobs from entering that chunk and stacking, but right now it only see's those 5 stacks of mobs as 5 single mobs).

Additions

Hi NerdNu, congratulations for this plugin! It is very useful!

Would it be possible you may add in the future:

  • Mobs with custom names/tag
  • Tamed mobs
  • Elder guardians
  • Dropped Items per name, ID, etc
  • Also a configurable message would be useful when the plugin executes the despawn action

This way your plugin can be used to limit almost everything, without the need of different plugins for the same thing!

Thank you very much and best regards!

Reappering entries in config

I want to prevent dogs and cats from being managed so I deleted

ocelot: 4
wolf: 4

But they keep reappearing. Should I do this? Or what exactly would prevent them from being managed?

ocelot: 
wolf: 

Or?

ocelot: -1
wolf: -1

I’m confused.

Could not pass event EntityPortalEvent to MobLimiter v3.0

Since a few days my console is getting spammed by the following error:

[21:18:26 ERROR]: Could not pass event EntityPortalEvent to MobLimiter v3.0
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.Entity.b(Entity.java:1821) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityItem.b(EntityItem.java:335) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.BlockEnderPortal.a(BlockEnderPortal.java:47) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.Entity.I(Entity.java:765) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.Entity.move(Entity.java:421) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.EntityItem.h(EntityItem.java:77) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.World.entityJoinedWorld(World.java:1620) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.World.playerJoinedWorld(World.java:1595) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.World.tickEntities(World.java:1460) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.WorldServer.tickEntities(WorldServer.java:516) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:706) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
Caused by: java.lang.NullPointerException
        at us.corenetwork.moblimiter.MobLimiterListener.onEntityPortal(MobLimiterListener.java:78) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_72]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        ... 18 more

Moblimiter Not working correctly with 1.7.2 and special mobs

i am haviing problems. it seems to not be working. i start with ~40 sheep in a pen, all in one chunk. then i leave the area, wait 5 minutes, restart server ect. then go back, and all the sheep are still there. not sure if i have to "enable" it, or if the syntax of the config.yml is incorrect. i've reinstalled the newest version and tried editing and reconfiguring the config.yml, but it still does not work. ill be in #llama on the irc if you want me to test some stuff

Non-mob entities

Is there a way to make this limit non-mob entities (minecarts, paintings, etc)
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.