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
You could take a look at how PocketMine's integrated /effect command works: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/command/defaults/EffectCommand.php [Permalink] Edit: Added Permalink
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