Force Mob Spawning Using NMS

Discussion in 'Plugin Development' started by Dsi_Mario, Feb 1, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Dsi_Mario

    I'm trying to make a plugin that uses custom spawning. I decided to completely redo spawning code. It became so complex that I was worried that it would cause a memory leak, and I only checked for a fall damage hazard. (I decided to scrap the code). I want to spawn a mob, but it must ignore hazards like lava, fall damage, cactus, etc... Like normal Minecraft spawning. Is there any way to do this? If I'm not clear, I want this to happen:
    Code:
    if(spawningconditionsaremet){
        spawnAMobThatIgnoresHazardsUsingNmsSomehow();
    }
     
  2. Offline

    The Fancy Whale

    1. Get random location
    2. Check to see if it meets your requirements
    3. Spawn a mob
     
  3. Offline

    Dsi_Mario

    Is there any other way to do this?
     
  4. Offline

    nverdier

  5. Offline

    Dsi_Mario

    If I wanted to spawn a mob in a 6 block radius of something (excluding y), random would have 9180 blocks to choose from. I would also have less control over when mobs spawn.
     
  6. Offline

    nverdier

    @Dsi_Mario You still control exactly when they spawn, just not the location... And what's wrong if random has that many options? But how did you get to that number?
     
  7. @Dsi_Mario
    Usually you won't get much help with NMS because of how complex it is. I would suggest looking to see how the server itself spawns NPCs.
     
Thread Status:
Not open for further replies.

Share This Page