Disable spawner temporarily

Discussion in 'Plugin Development' started by Hoeze, Mar 20, 2012.

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

    Hoeze

    I'd like to disable a mobspawner for some seconds. How do I solve this?
    If I use a CreatureSpawnEvent with SpawnReason.SPAWNER, I'm unable to get the spawner which caused the event..
     
  2. Offline

    Father Of Time

    Globally disable all spawners or do it on a spawner by spawner basis?
     
  3. Offline

    Njol

  4. Offline

    Hoeze

    aah, thanks, and which value do I need to enter for a delay of 30 seconds?
     
  5. Offline

    Father Of Time

    it doesn't state how the input variable is used, so I would use trial and error with the following:

    1 to 1 ratio ( 1 equals one second, so 3 = 3 seconds )
    20 to 1 ratio ( a Minecraft tick is 20L, so 20L * 3 = 3 seconds )
    1000 to 1 ratio ( milliseconds, so 3000 = 3 seconds )

    Minecraft doesn't really stick to one time duration method, sometimes it uses game ticks, sometimes it uses milliseconds and othertimes it just uses seconds. When in doubt just use trial and error, even if you put the wrong value in it will still compile, the durations just won't be the time lengths you expected (put 1000 milliseconds into a function that accepts seconds as an argument would result in the pause being 1000 seconds, not 1 )
     
Thread Status:
Not open for further replies.

Share This Page