CreatureSpawnEvent question

Discussion in 'Plugin Development' started by AGC-Intra, Mar 12, 2016.

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

    AGC-Intra

    Hello all,

    Issue: I have plugin I'm writing that needs to stop creatures from spawning in certain regions.
    So it current does that by cancelling the CreatureSpawnEvent if it matches certain criteria.
    When I look how often it is called in a normal city sized region it's like every second.
    This seems bad and too much.

    Question: Is there a better way to go about this?
    Way to stop CreatureSpawnEvent from firing if Creature it wants to spawn falls at certain location?
    The criteria doesnt even really matter just need to know how can I explain/set this to whatever is governing world spawning?
    Any ideas or direction would be appreciated.
     
  2. Offline

    Zombie_Striker

    Considering canceling the event barely takes up any memory, that is absolutely fine. To my knowledge, there is no "better way" considering there is nothing wrong with canceling the event.
     
  3. Offline

    AGC-Intra

    Afraid that may be the answer. Just like to try to keep resource/processing use as low as possible. Want to be sure I'm going about things properly. :)
    Thanks for the quick reply I'll leave it how it is for now and move on.

    EDIT:
    Just noticed my servers TicksPerMonsterSpawn was set to 1 which explains a spawn per second which is why I was thinking it was kind of bad (the event fire every sec). My bad. :rolleyes:
     
    Last edited: Mar 12, 2016
Thread Status:
Not open for further replies.

Share This Page