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

How to fix it?

Discussion in 'Development' started by MrSolik123, Feb 17, 2019.

  1. MrSolik123

    MrSolik123 Spider

    Messages:
    14
    TypeError: "Argument 2 passed to pocketmine\entity\DataPropertyManager::setFloat() must be of the type float, null given, called in phar:///home/PocketMine-MP.phar/src/pocketmine/entity/Entity.php on line 576" (EXCEPTION) in "src/pocketmine/entity/DataPropertyManager" at line 119
     
  2. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    what's your code?
     
  3. ZackyVN

    ZackyVN Baby Zombie

    Messages:
    150
    please send your code if u want other people help
     
  4. MrSolik123

    MrSolik123 Spider

    Messages:
    14
    $ionic->setDataProperty(self::DATA_SCALE, self::DATA_TYPE_FLOAT, $ionic->getDataProperty(self::DATA_SCALE) * $height / 100);

    return $ionic;
    }

    public function __construct(Level $level, CompoundTag $nbt)
    {
    parent::__construct($level, $nbt);

    $this->opened = (bool) $nbt->getString("Opened", false);

    $this->setNameTag("§f§lИонное поле");
    }


    /**
    * Returns is it opened
    *
    * @return bool
    */
    public function isOpened(): bool
    {
    return $this->opened;
     
  5. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    no need to set the data property itself if you want to set the scale, use $this->setScale();
     
  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.