Custom mobs disappearing after server restart

Discussion in 'Plugin Development' started by NemesisMate, Oct 19, 2012.

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

    NemesisMate

    How the title says I have that problem, when I restart my server all mobs in it stays but custom mobs.

    Why I having this problem?, it's possible to get the mobs stay where they where before restart after it?.

    Thanks for any help!
     
  2. Offline

    MrRedLogan

    custom mobs? explain a little more please.....
     
  3. Offline

    NemesisMate

    When I say custom mobs I mean mobs that I made extending an existing mob class. For example a mob extending the EntityZombie class.
    I add that mobs with:

    Code:
    MyZombie myzombie = new MyZombie(mcWorld, location);
    mcWorld.addEntity(myzombie, SpawnReason.CUSTOM);
    I saw that way to add customs from here and it functions well, my mobs spawns, the problem is that when I restart the server that mobs disappears, when I really need them to stay after restarting.
     
  4. did you figure it out?
     
  5. Offline

    fireblast709

    Save location and type, and spawn a new one onEnable()?
     
    CeramicTitan likes this.
  6. that would be horrible. had to store every mob, save list to file, load on start and place new mobs.
     
  7. Offline

    fireblast709

    You would only have to store its location and classname. Still would be kind of horrible though, but I don't know any better methods by just using the Bukkit API
     
  8. Offline

    SirTyler

    Unless you have instances of the normal mob and the new mob, just have every mob spawned (of the type, in your case Zombie) replaced by your custom version. Have your plugin load up BEFORE the world is loaded and then every mob that is created as the world is loaded should be replaced.
     
Thread Status:
Not open for further replies.

Share This Page