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

EntityInventoryEvent

Discussion in 'Development' started by Teamblocket, May 2, 2017.

  1. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    hey , so someone told me about EntityInventoryEvent and i made a plugin for it but the player doesn't get the message
    PHP:
         public function onTest(EntityInventoryChangeEvent $event){
            
    $player $event->getEntity();
               
    $newItem $event->getNewItem();
        
    var_dump("New Item: ".$newItem->getName());
               if(
    $newItem === "TEST"){
                     
    $player->sendMessage("test");
                      return;
              }
       }
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    What steps are you taking in-game to test this code?
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Entity::sendMessage() does not exist.
     
  4. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    so how can i send a message?
     
  5. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    nvm i got it <3 works prefectly thanks
     
  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.