Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Entity position problem

Comments in 'Plugin Development' started by Wii54_, Oct 15, 2016.

  1. Wii54_
    Offline

    Wii54_ New Member

    Joined:
    Oct 15, 2016
    Posts:
    4
    Minecraft User:
    Wii54
    I created an entity at a specific point, and then I set it on motion. But after I set it on motion, it's position that i get from it is still the position that i created it, not the position after i set it on motion. Help!
  2. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    It should actually work, what are you doing wrong?
  3. Wii54_
    Offline

    Wii54_ New Member

    Joined:
    Oct 15, 2016
    Posts:
    4
    Minecraft User:
    Wii54
    IDK, should i post my code?
  4. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Yeah please
  5. Wii54_
    Offline

    Wii54_ New Member

    Joined:
    Oct 15, 2016
    Posts:
    4
    Minecraft User:
    Wii54
    PHP:
            $player $p;
            
    $nbt = new CompoundTag();
            
    $nbt->Pos = new ListTag("Pos",[
                new 
    DoubleTag ""$player->),
                new 
    DoubleTag ""$player->$player->getEyeHeight () ),
                new 
    DoubleTag ""$player->)
            ]);
            
    $nbt->Motion = new ListTag "Motion", [
                new 
    DoubleTag "", - \sin $player->yaw 180 M_PI ) *\cos $player->pitch 180 M_PI ) ),
                new 
    DoubleTag "", - \sin $player->pitch 180 M_PI ) ),
                new 
    DoubleTag "",\cos $player->yaw 180 M_PI ) *\cos $player->pitch 180 M_PI ) )
            ] );
            
    $nbt->Rotation = new ListTag "Rotation", [
                new 
    FloatTag ""$player->yaw ),
                new 
    FloatTag ""$player->pitch )
            ] );
            
    $nbt->Size = new IntTag("Size",0);
            
    $speed 3.0;
            
    $slime Entity::createEntity "Slime"$player->chunk$nbt$player );
            
    $slime->setMotion($slime->getMotion()->multiply($speed));
            
    $slime->spawnToAll ();
  6. Wii54_
    Offline

    Wii54_ New Member

    Joined:
    Oct 15, 2016
    Posts:
    4
    Minecraft User:
    Wii54
    What's the problem?

Share This Page

Advertisement