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

Hold to Send word

Discussion in 'Plugin Help' started by Howtodoit, Sep 12, 2020.

  1. Howtodoit

    Howtodoit Spider Jockey

    Messages:
    35
    I wan it send "work bro!" when i hold item and it send repeat untill not hold it and can set Colldown

    Code:
    PHP:
    function onInteract(PlayerInteractEvent $event)
        {
            
    $player $event->getPlayer();
            
    $name $player->getName();
            
    $item $player->getInventory()->getItemInHand();
            
    $id $item->getId();
            if(
    $event->getAction() === PlayerInteractEvent::LEFT_CLICK_AIR) return;
            switch (
    $id) {

                case 
    419:
                            
    $this->$player->sendMessage("Work Bro!");
                            break;
                
                
            }
        }
     
  2. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    Make a repeating task for it
     
  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.