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

effect on command

Discussion in 'Development' started by hexmor, Aug 11, 2018.

  1. hexmor

    hexmor Baby Zombie

    Messages:
    110
    GitHub:
    h3xmor
    Hi
    I want to do something sometime a player writes a command, one effect give to target player
    Like:
    Target player: hexmor
    And i write this command:
    /nightvision hexmor
    Hexmor Give nightvision effect

    Or for example i want to give nightvision effect
    Wrute this command:
    (My user name is mahan)
    /nightvision mahan
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Muqsit and corytortoise like this.
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    PHP:
    $effect Effect::getEffect((int) 16); // 16 ID of Night Vision
    $duration 10 20// 10 Seconds of Night Vision
    $amplification 1//  1 amp For night vision
    $visible false//hide player or not
    $instance = new EffectInstance($effect$duration$amplification$visible); //Effect Instance
    $player->addEffect($instance); // Adds Effect
     
  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.