Mobs Despawning Wrong?

Discussion in 'Plugin Development' started by opd02, Jan 5, 2020.

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

    opd02

    So I have been working on this plugin that is sort of a mob vs. player arena. I use the following code to spawn in some mobs, however, the mobs have some sort of odd de-spawning time. I would be fighting them and some of them would just randomly disappear. Also, a WITHER I was killing that was spawned in using the same code as below also despawned right as I had just a few hits left to kill it. I dont think that mobs can normally despawn that fast, right?

    I was looking for some sort of MobDespawnEvent and cancel it if it happened, but I could only find ItemDespawnEvent and that seemed not to be triggered by mobs, just dropped items. Sort of stuck.
    Code:
            world.spawnEntity(loc, EntityType.ZOMBIE);
            world.spawnEntity(loc, EntityType.WITHER);
     
  2. Offline

    xelatercero

  3. Offline

    Niv-Mizzet

    Are you sure it's not just a glitchy server or a bug somewhere else in your code?
     
Thread Status:
Not open for further replies.

Share This Page