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

Hello there ,I need some help

Discussion in 'Plugin Help' started by Mr.Business, Apr 20, 2020.

  1. Mr.Business

    Mr.Business Spider

    Messages:
    7
    GitHub:
    xslimex
    Hello there,I'm trying to make a kitGUI plugin but I need help with a code:
    I want it like when you tap an item that is already on your inventory by the cosmetics to run a command,e.g:

    If player tap diamond sword
    Then execute command kitgui
     
  2. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    PHP:
    public function onInteract(PlayerInteractEvent $event){
        
    $player $event->getPlayer();
        
    $in $player->getInventory()->getItemInHand()->getCustomName();
        if(
    $in == "Item Name Here"){
            
    $player->getServer()->dispatchCommand($player"your_command_here");
        }
    }
     
  3. Mr.Business

    Mr.Business Spider

    Messages:
    7
    GitHub:
    xslimex
    Thank you!!!!
     
    ethaniccc likes this.
  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.