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

Protection Plugin

Comments in 'Plugin Development' started by Adversarius, Dec 30, 2015.

  1. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
    Hey there, it's me again,

    My question is, if there is an existing Protection Plugin? I try IProtector, but it's still in red when i start my Server, and WorldProtect isn't work anymore. If you have a cool Plugin (PocketMine Forums & GitHub) please send it to me.

    Special thanks :)
    Adversarius
  2. ItzMonster
    Offline

    ItzMonster New Member

    Joined:
    Dec 27, 2015
    Posts:
    2
  3. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
  4. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Wrong section! It's Plugin Development section, not Plugin Request section
  5. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
    My mistake, sorry :)
  6. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Cancel BlockBreakEvent and BlockPlaceEvent :p
  7. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
    Can't. I have Survival Worlds, and everybody can build there. :)
    Sry for my bad english lol
  8. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Cancel BlockBreakEvent and BlockPlaceEvent if player isn't on that map(s)
  9. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    public function onBreakk(BlockBreakEvent $b){// On Break
    if(!$b->getPlayer()->isOp){ // OP Can Break
    if($this->getServer()->getLevelByName("Name")){
    // Code  Break Block IN World Name
    $b->setCancelled(); // Can't break IN This World
    }
    }
    }
    public function 
    onPlaccce(BlockPlaceEvent $b){// On Place
    if(!$b->getPlayer()->isOp){ // OP Can Place
    if($this->getServer()->getLevelByName("Name")){
    // Code  Place Block IN World Name
    $b->setCancelled(); // Can't Place IN This World
    }
    }
    }
    use This Code For Break And Place its good
    Adversarius likes this.
  10. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
    And when i have more than one world i want to protect?
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    isOp is a function, not a property.
    Legoboy0215, applqpak and Vaivez66 like this.

Share This Page

Advertisement