1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Disable using Flint and Steel except for TNT

Discussion in 'Development' started by minijaham, Jan 7, 2021.

  1. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Hey, I've been forgetting everything about PMMP and I needed some reminders on some things like the title...

    Could someone please tell me a way to create the following?
    Disable usage of flint and steel unless it is on TNT
     
  2. OguzhanUmutlu

    OguzhanUmutlu Witch

    Messages:
    63
    GitHub:
    OguzhanUmutlu
    use it in your EventListener / Main file:
    PHP:
    public function onplayerinteract(pocketmine\event\player\PlayerInteractEvent $event) {
      if(!
    in_array($event->getAction(), [3,4]) && $event->getBlock()->getId() == 46 && $event->getPlayer()->getInventory()->getItemInHand()->getId() == 259) {
        
    $event->setCancelled();
        
    $event->getPlayer()->sendMessage()
      }
    }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.