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

$this->setDataProperty not found

Discussion in 'Development' started by Levi, Jun 20, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    trying to add fireworks but i get unknown $this->setDataProperty
    PHP:
    protected
        function 
    initEntity(): void
        
    {
            
    parent::initEntity();
            
    $random self::$random ?? new Random();
            
    $this->setGenericFlag(self::DATA_FLAG_HAS_COLLISIONtrue);
            
    $this->setGenericFlag(self::DATA_FLAG_AFFECTED_BY_GRAVITYtrue);
            
    $data = [
                
    self::$firework->getId(),
                
    self::$firework->getDamage(),
                
    self::$firework->getCount(),
                
    self::$firework->getCompoundTag()
            ];
            
    $this->setDataProperty(16self::DATA_TYPE_SLOT$data);
            
    $fly 1;
            try {
                
    $fireworktag $this->namedtag->getCompoundTag("Fireworks");
                if (
    $fireworktag !== null) {
                    
    $flytag $fireworktag->getByte("Flight"1);
                    if (
    $flytag !== null) {
                        
    $fly $flytag;
                    }
                }
            } catch (
    Exception $exception) {
                
    self::$exceptionlog $exception;
                
    $this->server->getLogger()->critical(self::$exceptionlog);
            }
            
    $rint = [
                
    $random->nextBoundedInt(5),
                
    $random->nextBoundedInt(7)
            ];
            
    $this->lifetime 20 $fly $rint[0] + $rint[1];
        }
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    The function doesn't exist, what did you expect?
     
    xXNiceAssassinlo YT 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.