Custom mob spawning in chunk

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

McAcrylic

Active Member
Oct 21, 2017
59
0
0
25
As the name suggests, I am looking for a system to custom mobs in a chunk. However, I have tried various methods, mostly resulting in server crashes, or straight up inefficient. I have looked through the forums for help, but nothing that matches my needs. This isn't a full request but I am asking how it should be done, better still, include the code.
 
I guess it depends on what you are trying to accomplish.
For example you could do

code_language.skript:
on chunk load:
    loop blocks within event-chunk:
        if loop-block is grass:
            add location of loop-block to {_spawning::*}
    set {_spawn} to random element of {_spawning::*}
    spawn zombie at location 1 above {_spawn}
This may not be the most efficient way to do it, but It works.
You could change the conditions for how you want mobs to spawn.
For example, after dark... a chance.... which mobs, etc
 
This may not be the most efficient way to do it, but It works.
You could change the conditions for how you want mobs to spawn.
For example, after dark... a chance.... which mobs, etc
Thanks for your help, I have not tested it, and I would assume what you have done would not crash the server.
 
Thanks for your help, I have not tested it, and I would assume what you have done would not crash the server.
I tested it with spawning giants (so i could see them as i flew around the world) and I had a lot of giants spawning.
Then I tested it with something like 10 sheep per chunk, LOTS OF SHEEP.... it didnt CRASH the server but definitely slowed it down, but thats a lot of sheep so no surprise
 
I tested it with spawning giants (so i could see them as i flew around the world) and I had a lot of giants spawning.
Then I tested it with something like 10 sheep per chunk, LOTS OF SHEEP.... it didnt CRASH the server but definitely slowed it down, but thats a lot of sheep so no surprise
Ye, I would assume so, and I did checked it out. However, I had to get a new system to do custom spawning.
It is basically a scanning system, whereby it checks the block x distance from player, detecting the chunk and the custom variable defined to that chunk to spawn a particular mob.

To simplify, it scans through nearby chunks which has a custom variable set to it to have a certain mob spawn at that location.

I want to hear from you if you feel this is an efficient method or not. But thank you for your suggestion!
 
Im not 100% sure if that would be efficient or not. I personally have never dealt with mob spawning before in a manner like this.
It always comes down to your event, how often you are checking and loop these blocks and chunks and how many players you have on, doing these things.
 
  • Like
Reactions: McAcrylic
Status
Not open for further replies.