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

Make player blind

Discussion in 'Development' started by Dyntes, Oct 2, 2020.

  1. Dyntes

    Dyntes Spider Jockey

    Messages:
    48
    GitHub:
    Dyntes
    Hey, do anyone know how to make a player doesn't see anything even their hand.. When I use blind effect the player still able to see a small area but I want the player can't see anything even a small area. If anyone know how to make that happen tell me as soon as posible.
     
  2. xLeakDev Enzo

    xLeakDev Enzo Spider Jockey

    Messages:
    38
    GitHub:
    nya-enzo
    Have you tried to put the effect amplifier to like 999 ?

    And for the player to doesen't see himself,

    You can do:

    - If you want that all players can see the target but the target can't see himself:
    PHP:
    /* $player is the player with blindness */

    $player->hidePlayer($player);
    And if you want to no one even the target to see him, just add invisibility effect to the target
     
  3. Dyntes

    Dyntes Spider Jockey

    Messages:
    48
    GitHub:
    Dyntes
    I don't want to make the player invisible but I want to make the player blind that can see nothing
     
  4. Dyntes

    Dyntes Spider Jockey

    Messages:
    48
    GitHub:
    Dyntes
    How to make the hide fuction for all player? Is...
    PHP:
    $allPlayer $this->getServer()->getOnlinePlayers();
    $player->hide($allPlayer);
    //Is like this?? But getOnlinePlayer() fuction will return to array so how to get all of the online player?
     
  5. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC

    PHP:
    foreach($this->getServer()->getOnlinePlayers() as $otherplayer){
         
    $player->hide($otherplayer);
    }
     
  6. Dyntes

    Dyntes Spider Jockey

    Messages:
    48
    GitHub:
    Dyntes
    So... I can use foreach() function to execute every elements on array, right?
     
  7. Matrox

    Matrox Slime

    Messages:
    92
    GitHub:
    MatroxMC
  8. GamingFR91

    GamingFR91 Spider Jockey

    Messages:
    29
    GitHub:
    kanekilechomeur
    It will hide allplayers and the target to blind too.
    And it will hide all players, then nobody can see one of them
     
  9. Primus

    Primus Zombie Pigman

    Messages:
    749
    Put player's head inside a block?
     
    Muqsit, THXC and minijaham like this.
  10. Exconic

    Exconic Spider

    Messages:
    14
    GitHub:
    poyq
    or give the player a effect to make them blind
     
  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.