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

Problem with my plugin

Comments in 'Plugin Development' started by MineBuilderFR, Apr 22, 2015.

  1. MineBuilderFR
    Offline

    MineBuilderFR Active Member

    Joined:
    Mar 14, 2015
    Posts:
    56
    Minecraft User:
    MineBuilderFR
  2. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    702
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Que voulez-faire exactement ?
  3. MineBuilderFR
    Offline

    MineBuilderFR Active Member

    Joined:
    Mar 14, 2015
    Posts:
    56
    Minecraft User:
    MineBuilderFR
    J'essaye de faire en sorte que le gâteau ne s'active pas . Qu'on ne puisse pas le manger .

    I try to ensure that the cake will not activate. We can not eat it.
  4. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    702
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    PHP:
            if (!file_exists($this->getDataFolder())) {
                @
    mkdir ($this->getDataFolder(), 0700true);
            }
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
            
    $this->config = new Config($this->getDataFolder() . "config.yml"Config::YAML, array(
                    
    "CAKE_BLOCK" => true,
    PHP:
        public function onPlayerInteract(PlayerInteractEvent $event){
            if((!
    $this->getConfig()->get("CAKE_BLOCK")) {
            
    $event->getBlock() === Block::CAKE_BLOCK);
               
    $event->setCanceled();
                
    $event->getPlayer()->sendMessage("Sorry, this CAKE_BLOCK is disabled!");

        }
      }
    peut être que c'est n'importe quoi , je ne suis pas en mesure de faire un truc propre avec mon téléphone
  5. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  6. Wantedkillerss
    Offline

    Wantedkillerss Active Member Plugin Developer

    Joined:
    May 9, 2014
    Posts:
    142
    Plugins:
    1
    Minecraft User:
    Wantedkillers
    actually true is the default of $event->setcancelled(); but u have to specify it for false
    PEMapModder likes this.

Share This Page

Advertisement