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

Solved Check player enter in hell portail or nether portal event

Discussion in 'Development' started by armagadon159753, Sep 20, 2017.

  1. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    like just onmove and id?
    seriously?
     
  3. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    It would be more efficient to identify nether portals when one is created rather than to identify the frame every time the player moves. Therefore, you are advised only to check when the player collide with a portal block but not to check the frames in move event. In addition, check portal creation when fire charge or flint&steel is used on an obeidian.
     
    sharletsings123 and jasonwynn10 like this.
  4. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    You have to correct yourself its nether portal and not hell as well as its portal not portail.
     
    armagadon159753 likes this.
  5. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    You can use the PlayerMoveEvent and find out if he's standing inside a block (Nether Portal Block):
    PHP:
    public function onMove(PlayerMoveEvent $event) {
        
    $player $event->getPlayer();
        if(
    $player->getLevel()->getBlock($player)->getId() === 90) { // if player stands inside Nether Portal Block
            // do something
        
    }
    }
     
    jasonwynn10 and armagadon159753 like this.
  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.