Changing the delay of spawners

Discussion in 'Spigot Plugin Development' started by stanjg, Feb 16, 2017.

  1. Hey,

    I need to change the spawn delay of mobspawners.

    I got my CreatureSpawner and I noticed the .setDelay(int) function. It just sets the delay for one time. I then set the delay every time a new mob spawns from the spawner with the SpawnerSpawnEvent, but this didn't work correctly, it set the delay before the event was done, so I put the setDelay function in a BukkitRunnable. This doesn't seem to work properly either. How should I do this?
  2. NathanWolf


    Did you call BlockState.update() after calling setDelay?

    I think you only need to set it once since it persists in tile entity data, unless you're trying to change it constantly.

    I could be wrong, I haven't done this myself but looking at the code I think it ought to work.
  3. No I didn't thanks for the suggestion, I can't try it now though.

    Verzonden vanaf mijn iPhone met Tapatalk