Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable command on a map

Comments in 'Plugin Development' started by MrReskill, Feb 6, 2016.

  1. MrReskill
    Offline

    MrReskill New Member

    Joined:
    Sep 21, 2015
    Posts:
    29
    Minecraft User:
    MrReskillYT
    Hello,
    I want to know how to disable a just order on a map
    as:
    /ban enabled on the world PVP
    /ban off the world SPAWN
    thank you in advance
  2. MineBuilderFR
    Offline

    MineBuilderFR Active Member

    Joined:
    Mar 14, 2015
    Posts:
    56
    Minecraft User:
    MineBuilderFR
    PHP:
        public function onCommandChat(PlayerCommandPreprocessEvent $event){
        
    $player $event->getPlayer();
        
    $cmd explode(" ",strtolower($event->getmessage()));
        if(
    $cmd[0] == "/ban" or $cmd[0] == "/othercommand" or $cmd[0] == "/othercommand" or $cmd[0] == "/othercommand" or $cmd[0] == "/othercommand"){
        if(
    $player->getLevel()->getName() == "Level"){
        
    $player->sendMessage("§4Not Allowed in This world sorry");
        
    $event->setCancelled(true);
        }
        }
        }
    I have not test code
    Last edited: Feb 6, 2016
  3. MrReskill
    Offline

    MrReskill New Member

    Joined:
    Sep 21, 2015
    Posts:
    29
    Minecraft User:
    MrReskillYT


    Thanks, please go twitter ;) ?

Share This Page

Advertisement