Solved How to define $event?

Discussion in 'Development' started by neb16, May 27, 2019.

  1. neb16

    neb16 Witch

    Messages:
    71
    GitHub:
    developerneb101
    So im trying to write a code that sets time to day, yes ik you can do /time set day but still. Anyways how would you define $event?
     
  2. iCirgio

    iCirgio Slime

    Messages:
    82
    GitHub:
    lolnova
    I don't understand?

    To set time day
    PHP:
    use pocketmine\level\Level;

    // let world be instanceof of a Level
    $world $this->getServer()->getLevelByName($worldname);
    $world->setTime(Level::TIME_DAY);
     
  3. neb16

    neb16 Witch

    Messages:
    71
    GitHub:
    developerneb101

    How do I get the world the player is in?

    $sender->getLevelName() ???
     
  4. neb16

    neb16 Witch

    Messages:
    71
    GitHub:
    developerneb101
    Never mind figured it out lol, ty for the help!
     

Share This Page

  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.