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

Help permission

Comments in 'Plugin Development' started by PolskiTHEPLAYER, Jan 24, 2016.

  1. PolskiTHEPLAYER
    Offline

    PolskiTHEPLAYER New Member

    Joined:
    Apr 1, 2015
    Posts:
    55
    Minecraft User:
    Flsmers
    What add permission to open chest in spawn?
  2. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    You must use PlayerInteractEvent, check if its an chest and then do something like $sender->hasPermission. I don't know the exact syntnax right now.
  3. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    PHP:
    public function onOpen(PlayerInteractEvent $event){
        if(
    $event->getBlock()->getID() === 54 && $event->getPlayer()->hasPermission("plugin.openchest"){
            
    //code
        
    }
    }
  4. PolskiTHEPLAYER
    Offline

    PolskiTHEPLAYER New Member

    Joined:
    Apr 1, 2015
    Posts:
    55
    Minecraft User:
    Flsmers
    Thanks :)

Share This Page

Advertisement