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

IGNORE

Discussion in 'Facepalm' started by Junkdude, Jun 30, 2017.

  1. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    So I'm attempting to spawn an entity, trouble is it will not spawn. No errors, warnings, etc in the console.
    PHP:
    public function handleHologram($var) {
        
    $nbt = new CompoundTag("", [
                new 
    ListTag("Pos", [
                    new 
    DoubleTag(""$block->getX() + 0.5),
                    new 
    DoubleTag(""$block->getY()),
                    new 
    DoubleTag(""$block->getZ() + 0.5)
                ]),
                new 
    ListTag("Motion", [
                    new 
    DoubleTag(""0),
                    new 
    DoubleTag(""0),
                    new 
    DoubleTag(""0)
                ]),
                new 
    ListTag("Rotation", [
                    new 
    FloatTag(""lcg_value() * 360),
                    new 
    FloatTag(""0)
                ]),
            ]);
        
    $entity Entity::createEntity('Zombie'$var->getLevel(), $nbt);
        
    $entity->setNameTag("test");
        
    $entity->spawnToAll();
        }
     
  2. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    Have you tried debugging by printing out the steps?
     
  3. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    Will do
     
  4. Matthew

    Matthew Baby Zombie

    Messages:
    167
    GitHub:
    matthww
    So how did you solve it? It might help others...
     
  5. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    Long story short, i forgot to call the function that calls this function so +1 :facepalm: for me
     
  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.