Considerations when making pets available

Discussion in 'Plugin Development' started by MCMastery, Apr 13, 2017.

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

    MCMastery

    I am working on a plugin for a multiplayer survival RPG server. Is there anything I have to take into account when making pets available for multiplayer? Will they despawn? If so, how do I prevent that?

    I know I can just google that question, but that's just an example. (Don't answer that :p)

    I don't want to start the server and have pets all screwed up. Thanks!
     
  2. I'm sry, but I don't get exactly what you are trying to do.

    Which type of "pets" do you mean? Just tamed animals? Or from a plugin?
    @MCMastery
     
    MCMastery likes this.
  3. Offline

    Caderape2

    @MCMastery

    LivingEntity has a method #setRemoveWhenFarAway(); I never used it but that should not despawn pets.
    When the server unload, chunks are saved, entity should be saved too.

    I'm not sure, but you cant try.
     
    MCMastery likes this.
  4. Offline

    MCMastery

    @Erumeldor I just want to make sure that pets should be handled similar to single-player. IDK if there may be differences to how pets behave because it is multiplayer (Like pets despawning when player leaves chunk, but other players are still online so they stay in unloaded chunk (normally they just teleport to you))

    By pet I just mean a tamed animal (dogs, cats, tamed horses, tameddonkeys, etc.)

    @Caderape2 Thanks! I'll check it out
     
  5. Normally, animals do not despawn. See MC-Wiki. (I normally would send you a link, but I'm on buisness network, so these sites are not allowed :p)

    From what I remember is, that normal mobs do not despawn, but monsters do if the chunk is not loaded.
    So your pets won't despawn, no matter if the chunk is loaded or not. (of course they can be killed, but that is another question)
    @MCMastery
     
    MCMastery likes this.
Thread Status:
Not open for further replies.

Share This Page