Changing the Spawnrate ?

Discussion in 'Plugin Development' started by Uniclaw, Aug 16, 2012.

  1. Offline

    Uniclaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Hi !

    today i have experimented a bit with the spawning of entitys, but how i can not allow/disallow the spawning but just changing the spawning rate ??
  2. Offline

    Uniclaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    anybody?
  3. Offline

    Njol

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Edit the bukkit.yml
  4. Offline

    Uniclaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Yes, this is a possibility, but i would make it in my plugin :/
  5. Offline

    kabbage

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    To reduce the spawn rate, you could make it so for a percentage of the time, the CreatureSpawnEvent would be cancelled.

    So, to make the spawn rate 50%...
    Code:
    @EventHandler
    public void onCreatureSpawn(CreatureSpawnEvent event) {
        if(Math.random() > 0.5)
        {
            event.setCancelled(true);
        }
    }
    Increasing the rate is a bit trickier. You could spawn an extra mob during each spawn, on the location the first mob spawned, to double the rate, I suppose...
  6. Offline

    Uniclaw

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks a lot!! :D

Share This Page