1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Level::getEntities()

Discussion in 'Development' started by SkySeven, Oct 27, 2018.

  1. SkySeven

    SkySeven Baby Zombie

    Messages:
    145
    GitHub:
    SkySevenMC
    Hello, when I use $level->getEntities() at onEnable() it's return an empty array but there are entities in this world.It's normal ?Sorry for my bad english.
    Thank's you in advance :)
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Yes it is. Level->getEntities() returns an array with only the entities in the loaded chunks, which means it will return [] because there are no chunks loaded yet.
     
    SkySeven likes this.
  3. SkySeven

    SkySeven Baby Zombie

    Messages:
    145
    GitHub:
    SkySevenMC
    Yes it's true, thank's you.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.