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

Door permission

Comments in 'Plugin Development' started by Artide, Jul 19, 2015.

  1. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    I want to make a plugin that only players who have permission can open a door, please and thank you.
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Idk it will work but... Try to cancel PlayerInteractEvent if touched block was door, but i think it will open the door and then close it so players will be able to bug it :p
    Legoboy0215 likes this.
  3. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    PHP:
    public function onInteract(PlayerInteractEvent $e){
            
    $p $e->getPlayer();
            if(
    $b->getId() === 64){
                if(!
    $p->hasPermission('opendoor')){
                    
    $e->setCancelled();
                    
    $p->sendMessage('blabla');
                    return;
                }
            }
        }
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Yeah but as i said no use :p They still can break and there is small interval between break and place so they can use it to run through same with open
  5. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    but pocketmine has protection for that
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    What protection?
  7. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    player canĀ“t go through closed door
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Make them iron doors.

    Also, there is no protection. If a player can glitch through a door, he can also make a mod to pass through walls, or simply break blocks and glitch through them.
  9. ahoj_truhliku
    Offline

    ahoj_truhliku Banned

    Joined:
    Jul 9, 2015
    Posts:
    89
    Minecraft User:
    Creeperface001
    what so why when i make protected area using IProtector so players can not go throgh closed doors?
  10. DrkLord_TNT
    Offline

    DrkLord_TNT New Member

    Joined:
    Jul 20, 2015
    Posts:
    1
    Minecraft User:
    Hassan
    Plzz can someone help me...
    i want to have a plugin that lock doors in mcpe server:)

Share This Page

Advertisement