Sudden Death - Wiki

Oct 6, 2019
Sudden Death - Wiki
  • [​IMG]
    Welcome to the Sudden Death documentation.
    Custom Mobs - Spawn Coefficient
    Spawn coefficient determines the frequency which the mob spawns at.

    SuddenDeath does not make extra mobs spawn in your server, it only replaces vanilla mobs when these spawn. When a vanilla zombie spawns, depending on the spawn coefs you set, it might turn into a custom mob or stay a vanilla mob.

    Spawn chance for any custom mob depends on the spawn coefficients of every other mobs which use the same mob type (zombie/creeper/...). The higher the spawn coefficient, the more likely a custom mob will be chosen. The higher the default spawn coefficient (can be changed under config.yml), the greater the chance of the mob staying vanilla.
    [​IMG]

    The chance (frequency) for a custom mob to spawn can be calculated using this formula:
    spawn_chance = mob_spawn_coef / (sum_of_all_spawn_coefs + default_spawn_coef)

    This is what SD does when spawning a mob:
    1. The plugin adds up all the spawn coefs of all the mobs under a specific mob type.
    2. Generates a random number between 0 and the sum it just calculated.
    3. Takes and spawns the corresponding mob if there is no format issue.

    Example
    Code (Text):
    Z_ONE:
      equipment:
        helmet: '[material=AIR:0]'
        chestplate: '[material=AIR:0]'
        leggings: '[material=AIR:0]'
        boots: '[material=AIR:0]'
        mainHand: '[material=AIR:0]'
        offHand: '[material=AIR:0]'
      name: My Custom Mob
      eff: {}
      spawn-coef: 3 // <----
      hp: 20
      atk: 4
      ms: 0.02
    Z_TWO:
      equipment:
        helmet: '[material=AIR:0]'
        chestplate: '[material=AIR:0]'
        leggings: '[material=AIR:0]'
        boots: '[material=AIR:0]'
        mainHand: '[material=AIR:0]'
        offHand: '[material=AIR:0]'
      name: My Custom Mob
      eff: {}
      spawn-coef: 5 // <----
      hp: 20
      atk: 4
      ms: 0.02
    Z_THREE:
      equipment:
        helmet: '[material=AIR:0]'
        chestplate: '[material=AIR:0]'
        leggings: '[material=AIR:0]'
        boots: '[material=AIR:0]'
        mainHand: '[material=AIR:0]'
        offHand: '[material=AIR:0]'
      name: My Custom Mob
      eff: {}
      spawn-coef: 10 // <----
      hp: 20
      atk: 4
      ms: 0.02
     
    Z_ONE has a 3 spawn coef. Z_TWO has a 5 spawn coef and Z_THREE has a 10 spawn coef. Let's assume that the default zombie spawn coefficient is 20.
    • Z_ONE has a 3 / ((3 + 5 + 10) + 20) = 7.9% chance to replace vanilla zombies.
    • Z_TWO has a 5 / ((3 + 5 + 10) + 20) = 13% chance to replace vanilla zombies.
    • Z_THREE has a 10 / ((3 + 5 + 10) + 20) = 26% chance to replace vanilla zombies.
    • Zombies have a 20 / ((3 + 5 + 10) + 20) = 53% chance to stay vanilla.
    You should get 100% when adding up all the chances.
  • Loading...
  • Loading...