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

asking about some events

Comments in 'Plugin Development' started by amiremad, Dec 12, 2015.

  1. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    what is the player ban event name in pocketmine

    and player ban-ip event name
    CraftingMania likes this.
  2. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    There is no player ban event.
    CraftingMania likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is no such event.
    You can try checking that with PlayerCommandPreprocessEvent, but it won't work if it is a plugin that banned the player.
    CraftingMania likes this.
  4. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    so i am disableing ban for ops i know how to do it but i need the event so when ban happens it gets unbanned at the same seccond
    CraftingMania likes this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then why don't you simply disable the ban...
    CraftingMania likes this.
  6. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Just check the message during PlayerCommandPreprocessEvent for /ban and cancel the event if found
    CraftingMania likes this.
  7. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    I cancel event if player is op
    CraftingMania likes this.
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Cancel player kick event
    PHP:
    public function onKick(PlayerKickEvent $event){
    if(
    $event->getReason() === ''// Idk what reason is for ban
    $event->setCancelled(true);
    }
    Or automaticly pardon him.
    PHP:
    public function onPreLogin(PlayerPreLoginEvent $event){
    if(
    $event->getPlayer()->isBanned() and $event->getPlayer()->hasPermission('avoid.ban')){
    $event->getPlayer()->setBanned(false);
    }
    }
    CraftingMania and amiremad like this.
  9. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    Thx is there a pardon ip
    CraftingMania likes this.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    For IPs, you have to use the server ip bans BanList.
    Primus and CraftingMania like this.

Share This Page

Advertisement