Inactive [MECH] CivilizedSpawn v1.0 - Keep monsters out of civilized areas! [1185]

Discussion in 'Inactive/Unsupported Plugins' started by sluvine, Mar 12, 2011.

  1. Offline


    CivilizedSpawn - An elegant spawn plugin, for a more civilized age...
    Version: 1.0
    The original plugin for controlling where evil mobs spawn. Now with more configuration!!!

    First and foremost, I'd like to thank ShadowOfLegends, a good friend of mine, without whom this plugin wouldn't exist. I had forgotten just about everything about java and knew nothing about bukkit api until he helped me through it :)

    My players and I didn't like the thought of having to put down giant torch grids to keep monsters away. It looks bad and it isn't even foolproof - mobs still spawn on top of trees since the light doesn't reach the top of the leaves. This plugin forces monsters (and only monsters, animals aren't affected) to check their surroundings before spawning. If any "man-made" blocks are found within a given radius, the spawn is cancelled and they move along to the next potential spawn.

    This allows monsters to spawn outside of "civilized" areas such as cities or well-developed mines, but natural caves, mob spawner dungeons, and the general "wilderness" should be unaffected.

    How It Works:
    1. As long as ignore_animals is set to true, this plugin will not affect the spawning of friendly mobs.
    2. Checks if there is a mob spawner within a 5-block cube of the attempted spawn. If there is, assume spawn is in a dungeon and allow it regardless of surroundings. This feature is now optional (allow_dungeon_spawn) and defaults to true.
    3. Checks the level at the spawn and the level directly beneath it(so mobs can spawn under trees but not on them) in a 5-block radius for LEAVES blocks. If there are at least 4 of them, assume spawn is on top of a tree and cancel it. This feature is now configurable (allow_treetop_spawn) and defaults to false. The number of leaves to check for is also configurable now (minimum_leaves) and defaults to 4.
    4. In order to allow mobs to spawn in abandoned mine shafts, I included an optional feature (ignore_near_cobwebs) that checks for a number of cobwebs (cobweb_limit). If enough are found, then the plugin is ignored in this area.
    5. The best solution I could come up with for allowing mobs to spawn in strongholds was placing check for the height (Y-level) of the spawn point that causes the plugin to ignore spawns below a certain level. This defaults to 55 and is configurable (ignore_below). 55 seemed like a good starting value since sea-level in-game is 63, but there are occasionally above-ground surfaces that are below sea-level but not covered by water.
    6. Once all these checks are passed, the plugin functions by checking a cubic area (block_check_radius, block_check_height). The radius defaults to 15 and the height defaults to 5, so the full area checked is a 31x31x11 cube (including the block at the spawn point being checked). The plugin looks for man-made blocks in this area. The man made blocks are now configurable in a list (detect_block_types).
    7. If Structure Detection is enabled (use_structure_detection), then if the plugin finds a man-made block in the first check, it performs a second check on a smaller area. (struct_detect_radius, struct_detect_height). This configurable value defaults to a radius of 5 and a height of 2, for a total area of 11x11x5 (including the block at the spawn point being checked). If enough blocks are found in this smaller area (struct_detect_threshold, defaults to 3), then the first block is counted in the total. If enough of these "structures" are detected (block_check_threshold, defaults to 10), then the spawn is cancelled.
    8. If Structure Detection is not enable, then the original 31x31x11 check is the only one that occurs. If enough blocks are found (uses block_check_threshold) then the spawn is cancelled.
    9. As of v0.8, the plugin also tracks the total man-made blocks found by the first search (the 31x31x11) area. In order to increase accuracy and decrease the load that having a larger search radius caused, if at least 500 blocks in that area are man-made, the spawn is cancelled. It seems like a lot, but it's only 5% of the total blocks, and I found this to be the optimal number. The value is configurable (hard_cancel_threshold).
    Known Issues:
    • This tends to interfere with above-ground mob grinders since it cancels spawning near man-made blocks. If you make your grinder out of natural blocks, you shouldn't have an issue.
    • Buildings made from smooth stone (the type that occurs naturally) and or sandstone will not be detected by the plugin. This doesn't necessarily mean monsters will spawn there, however. If there are other blocks that the plugin does detect in the area, or a high enough light level, then monsters will not spawn. I am working on a way for the plugin to determine the difference between natural stone and player-placed stone without having to resort to the use of a database.
    Go to the Downloads link above, then pick the version you want to download. The newest stable version is the latest one that I've tested and deemed usable. The older versions are usable too, but might not have some of the newer features. Once you've downloaded the file, simply throw the .jar in your plugins folder! After you run your server for the first time, the CivilizedSpawn folder will generate with the default config.yml inside.

    Show Spoiler

    Below is the default config.yml with explanations of each variable:
    block_check_threshold: 10
    #If use_structure_detection is true, this is the number of man-made block clusters that must be found
    #If use_structure_detection is false, this is the total number of blocks that must be found
    ignore_animals: true
    #This determines whether or not the plugin affects animal spawns
    struct_detect_radius: 5
    #This is the search radius used by Structure Detection, if enabled
    struct_detect_height: 2
     #This is the search height used by Structure Detection, if enabled
    hard_cancel_threshold: 500
    #If at least this many blocks are found in the search, the spawn is cancelled
    ignore_below: 55
    #The plugin doesn't cancel any spawns lower than this number (use F3 to check the Y values of your town's ground and make sure this number is at least 1 less than the lowest point). It is not recommended to set this higher than 63 (sea level).
    cobweb_limit: 1
    #If ignore_near_cobwebs is enabled, this is the number of cobwebs that must be found for the plugin to allow a spawn near man-made blocks
    allow_treetop_spawn: false
    #This determines whether or not to allow mobs to spawn on top of trees
    block_check_radius: 15
    #This is the search radius of the general search made by the plugin
    ignore_near_cobwebs: true
    #If enabled, the plugin will allow mobs to spawn near cobwebs since this is an indicator that the spawn is in an abandoned mineshaft
    block_check_height: 5
    #This is the search height of the general search made by the plugin
    minimum_leaves: 4
    #This is the smallest amount of leaves that must be present for the treetop spawn canceller to activate
    use_structure_detection: true
    #If enabled, the plugin makes a second check around each man-made block that it finds to look for other man-made blocks around it. This prevents players exploiting the plugin by randomly placing man-made blocks to prevent spawns.
    struct_detect_threshold: 3
    #When Structure Detection is on, Structure Detection must find at least this many blocks around the first one detected for it to count towards the block_check_threshold
    allow_dungeon_spawn: true
    #This allows mobs to spawn near mob spawners
    #These are the block types that the plugin will search for. Putting things like DIRT, SAND, GRAVEL, or STONE in this list will likely eliminate a lot of spawns that you didn't mean to eliminate. These values must match the names of the materials in the Materials ENUM and can be found here: [URL][/URL]
    - WOOD
    - BRICK
    - FENCE
    - STEP
    - WOOL
    - CHEST

    Show Spoiler

    • 1.0
      • Made everything configurable!
      • Updated the plugin to function with new Adventure Update mobs and block types.
      • Added a height limit for the plugin to help keep strongholds populated with mobs.
      • Added cobweb detection to keep abandoned mine shafts populated with evil blue spiders.
      • Did I mention, it's CONFIGURABLE?!
    • 0.8
      • Fixed stupid bugginess by optimizing the search for structures
      • Implemented a combined threshold for proper spawns so that a creature still doesn't spawn in a bare patch in between large buildings like before. However, spaces wider than a 20*20*5 block tetrahedron without man-made blocks will still allow spawns. Build a road or a fountain or something else that looks pretty in the empty space if you're having problems in your towns.
      • Started cleaning things up to make just about every aspect of the plugin end-user customizable. v1.0 should be coming soon with full customization.
    • 0.7.4
      • Actually added wool to the list of materials (I forgot last time >.<)
      • Worked out some bugs with structure detection and increased the search radius to reflect the higher level of specificity required to find structures. The radius was too small once I moved from the 0.5 system to the 0.7 system. I doubled it and the plugin is now working as effectively on my test server as it was with 0.5.2.
      • Made the plugin insanely buggy and laggy! Don't use this one unless FPS over 2 makes you cry.
    • 0.7
      • Added wool, both types of stairs/slabs/doors to the check for structures
      • Improved the structure detection algorithm to check for adjacent blocks rather than just a disorganized group
    • 0.5.2
      • CivilizedSpawn submitted for release on Bukkit forums!
      • fixed empty dungeons due to cobblestone (stops the search if a mob spawner is found nearby) (Verified that this works! Yay! :))
      • changed the way detection works
        • instead of cancelling as soon as a man-made block is found, increments a counter and if that counter exceeds a given level, then cancel.
        • the idea being that the plugin should look for structures, not single blocks.
        • still very open to any suggestions on better methods
      • adjusted search radiuses again
      • started adjusting code to make things configurable
    • 0.5.1
      • added additional check to keep monsters from spawning on trees (this annoyed me, but it'll be able to be turned off once this is configurable)
      • cleaned up extra code
      • commented the code to increase readability
    • 0.5
      • Plugin begins testing!
      • set up basic detection capability

    Todo list:
    Show Spoiler

    • High Priority: Possibly add a specific checks for adjacent blocks instead of just a total number of blocks in a range (to decrease detection of randomly scattered cobbles and focus on structure detection)
    • Find a dungeon on our server to make sure they're working again as of 0.5.2
    • Upload source code for other folks to look at I'll do this if someone requests it...
    • High Priority: Make block types, search radius, allow_tree_spawn true/false, structure_detection true/false, etc. all configurable
    • Look into possible tie-in with World Guard Regions (ability to set no-hostile-spawn zones, no-neutral-spawn zones, and no-any-spawn zones) for larger pop. servers as this will reduce the performance impact
    • Make structure detection work on a separate counter from the search counter.
    • Add slabs, doors, stairs, and wool to the check
    • Any other good ideas that come along!
    Pisi-Deff, Digi and Maxwolf Goodliffe like this.
  2. Offline


    I love the idea for this mod, it sounds exactly like what my server could use! I'm currently toying with the config file to try and get it to work though lol, as default doesn't seem to be very effective or doing anything at all. Was wondering if anyone with a working setup could post their config file and why they decided to set it up in that way? Might be helpful to some of us trying to figure it out :)
  3. Does this work only with the default materials in the config, or can I add my own? Because we build huge tunnels for trains and the only man-made block there are rails, booster-rails, redstone-torches and torches...

    Couldn't you just use the method Material.getMaterial(String name) to get materials from the config and search for them? Would increase the customization a lot!

    Oh, and one question: If the plugin checks an area in which are 5 blocks, which will be counted as a structure. Does it count 5 blocks now, or just one, because all blocks refer to the same structure?
  4. Offline


    does it work with 1597?
  5. Offline


    Same question here :(
  6. Offline


    Sounds awesome. The how it works was kind confusing, by "man made" do you mean literally right-click-to-place by a player, or any block besides what naturally spawns in the world?
  7. Offline


    It's a list of blocks. You can add/subtract to/from the list.

    Any updated plugins similar to this?
  8. Offline


    k thanks.
  9. So I can add any material I want? Also that ones, which are not in the default list?
  10. Offline


    Possibly only blocks supported by the plugin. This plugin should support most of them, but is outdated and might not support some of the newer ones or work at all.
  11. Offline


    Could you make a video on how to use it? It would help alot.
  12. Offline


    The plugin has no effect on my server. Does anyone have it working?

    Last ping from author was Sep 29,2011. Is this plugin dead?

    If yes, is the sourcecode available?
  13. Offline


    Seems like it's dead. But it still works great for me in this pretty old 1185 version.
  14. Offline


    does anyone know of a plugin like this one?
    it helps my 6year old a lot (sick of hearing, "will everyone go to bed" every 10 mins)
  15. Offline


    Plugin download link IS NOT WORKING!
  16. Offline


    I downloaded this and put it in my plugins folder. When I ran the server, it said, "Error occurred while enabling CivilizedSpawn v1.0 (Is it up to date?)
  17. Offline


    this is exactly what I am looking for but get this error.

    java.lang.NoClassDefFoundError: org/bukkit/event/entity/EntityListener
  18. Offline


    Cool plugin. I should try this, but there is one thing I want to ask,
    1. Do you need to place blocks to calibrate the safezone area?
    2. Will this plugin affect surroundings?
    3. Can this plugin turn my server laggy? (I currently have 6 plugins)
  19. Offline


    Hello people!

    Since sluvine hasn't updated the plugin in a long time, I made a new one that does the same function.

    You can find it here:

    I made it fully open-source so if it becomes incompatible someday and I'm not around to fix it, someone can fork the repository and work on it!

Share This Page