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

Solved Chest wont send message

Discussion in 'Development' started by xXNiceAssassinlo YT, Apr 19, 2018.

  1. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    PHP:
        public function onInteract(PlayerInteractEvent $event) : void{
            
    $player $event->getPlayer();
            
    $block $event->getBlock();

            if(
    $block->getId() === 54 && $block->getDamage() === 100){
                
    $player->sendMessage("hi");
            }
        }

     
  2. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    1. Is your event registered? 2. Is the block your tapping damage 100?
     
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    1. yes 2. yes
    i registered it than i give item myself by /give xxnice Chest:100
     
  4. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Try this
    PHP:
    public function onInteract(PlayerInteractEvent $event) : void{
            
    $player $event->getPlayer();
            
    $block $event->getBlock();

           
    var_dump($block->getDamage());
        }
    And post the dump
     
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    int(0)
    int(4)
     
  6. Daniktheboss

    Daniktheboss Baby Zombie

    Messages:
    144
    GitHub:
    daniktheboss
    Just as i thought, the damage doesn't save on items that don't use that damage. You will have to put nbt on the item, and check the nbt
     
  7. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    k
     
  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.