Help with spawn limiting

  • Thread starter Deleted member 17753
  • Start date
  • 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.
D

Deleted member 17753

Hi there! I am using this code to limit entities per chunk.
Code:
on spawn:
    if size of entities in chunk of event-entity >= 65:
        cancel event

on vehicle create:
    if size of entities in chunk of event-entity >= 65:
        cancel event

on chunk unload:
    delete all entities in event-chunk

But vehicles are just spawnable no matter how many entities there are already, and I have a person doing some weird stuff with pistons and end crystals which seems to get around it.
I'm very new to this so some help would be great.
 
Does "size of entities in chunk of event-entity" output the right amount of entities?
Yes it works fine apart from vehicles, I realised that the thing with end crystals was pushing it across chunk borders, so maybe I should check in a 16 block radius or something rather than the chunk?
 
Status
Not open for further replies.