Help how to spawn random mobs on world

Discussion in 'Spigot Plugin Development' started by ImMarvolo, Jul 19, 2018.

  1. How to spawn random mobs on world.

  2. generate a world
    play minecraft

    Gonna have to be more descriptive than that if you want help
    • Funny Funny x 1
  3. I need spawn ramond mobs on world. Ex: In a game of skywars spawn random mobs to island.
  4. Get all the islands, loop through the locations. You could use a chance system to determine if the location has an entity, you could then choose a random entitytype using the same chance system and then spawn a certain type of mob in that location, you could do it in one "for" loop :)
  5. A cheapskate method would be to listen for CreatureSpawnEvent, and then spawn your custom mob when a certain mob type (Like let's say, a cow) spawns. You could also easily add a spawn chance that multiplies with the cow's spawnrate. Lastly, you could cancel the spawn event so the cow doesn't spawn alongside the custom mob.

    Many ways to go about it, depending on what you need.