Amount of entities in chunk or near player

  • 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.

bebeli555

Member
Feb 6, 2020
28
0
0
25
So anyone know is it possible to like get all entities or specific type of entites in chunk and store it into a variable or like get the amount of entities in radius of 20 of player? im trying to make a thing that would stop people from spamming so many minecarts into 1 spot so if i can get the amount of minecarts or all entities in chunk i could do that
 
So anyone know is it possible to like get all entities or specific type of entites in chunk and store it into a variable or like get the amount of entities in radius of 20 of player? im trying to make a thing that would stop people from spamming so many minecarts into 1 spot so if i can get the amount of minecarts or all entities in chunk i could do that

Code:
set {_list::*} to all entites where [input's chunk is {_chunk}]
change this condition so it does what you want
Code:
input's chunk is {_chunk}
input: is the entity which is being checked after executing this effect
{_chunk}: is a local variable that holds a chunk type, you can replace it by an expression depends on what are you trying to do.
{_list::*} is a local list that will holds all entites that matches specific conditions we determine earlier.
 
  • Like
Reactions: bebeli555
Yeah thanks i came up with this yesterday to limit max entities in chunk

Code:
on vehicle create:
    loop all entities:
        if size of entities in chunk of event-entity >= 65:
            cancel event
 
Yeah thanks i came up with this yesterday to limit max entities in chunk

Code:
on vehicle create:
    loop all entities:
        if size of entities in chunk of event-entity >= 65:
            cancel event
why looping through all entities ? you don't need that
 
Status
Not open for further replies.