natural spawning for a custom entity (not nms)

Discussion in 'Spigot Plugin Development' started by PmzHeroV2, Sep 15, 2021.

  1. i have an entity and a spawnentity method
    i want to know how to spawn the livingentity naturaly with a chance like zombies, pigs and stuff
    and it seems i posted it in the wrong category so i just reported the thread to be deleted
     
  2. My first thought would be to listen to the EntitySpawnEvent and check if the Entity is not instanceof Item.

    If that is the case, I would randomize the chance of your mob to appear. So for example "new Random().nextInt(100) < 30" defines a 30% chance.

    If all these cases are true, just remove the entity that just spawned and spawn your own custom mob at the location the entity just spawned.