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

why CompoundTag can't call to method?

Discussion in 'Development' started by Hoyee, Feb 16, 2020.

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\nbt\tag\CompoundTag::multiply()"

    if I use $nbt->multiply($i), it crash but when I use $directionVector->multiply($i), It works.
    Why not CompoundTag?



    1. for ($i=0; $i<10; $i++){
    $pos = $nbt->multiply($i)->add($player);

    2. for ($i=0; $i<10; $i++){
    $pos = $directionVector->multiply($i)->add($player);
     
  2. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    Because CompoundTag hasn't multiply() method. Maybe you wanted to use some Vector class...
     
  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.