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

point compass

Comments in 'Plugin Development' started by Creeperface, May 27, 2015.

  1. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    how to point compass to specified place without level spawn change?
    CraftYourBukkit likes this.
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Oh thanks
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    @shoghicp will yell at you again for using packets directly.
    HotFireyDeath likes this.
  5. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Is there a better way?
  6. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    You know, I do not want to see him yell again...
    BlubberBoy333 likes this.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes in future API updates.
  8. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Well, when it is available, please share. This is something that I didn't expect @shoghicp to ever implement.
    iksaku and PEMapModder like this.
  9. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Love to see that these type of methods solve problems that will never be natively solved by PocketMine-MP API xD
  10. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    i tried this but player compass is still pointed to same point.
    PHP:
    public function pointCompass(Player $p$x$z){
            if(
    is_numeric($x) && is_numeric($z)){
                
    $pk = new SetSpawnPositionPacket();
                
    $pk->$x;
                
    $pk->1;
                
    $pk->$z;
                
    $p->dataPacket($pk);
                
    $p->sendMessage(TextFormat::GREEN."kompas byl uspesne nasmerovan");
            }
            else{
                
    $p->sendMessage(TextFormat::RED."Musis zadat platne souradnice!");
            }
        }
  11. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Why not just to use Player's position?
    PHP:
    public function pointCompass(Player $player){
        
    $pk = new SetSpawnPositionPacket();
        
    $pk->$player->getX();
        
    $pk->$player->getY();
        
    $pk->$player->getZ();
        
    $player->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
    }
    iJoshuaHD likes this.
  12. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Player can run command /point x z i need it for player who lose home when i update essentialsPE xD
  13. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    and still doesn´t work :/
  14. cake23
    Offline

    cake23 Active Member

    Joined:
    Aug 10, 2015
    Posts:
    124
    Minecraft User:
    TheEnd
    Do you have now a way how to make a compass tracker? (So if I tap a block with a compass, the compass show me the next player.)
  15. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    No probably MCPE bug
    cake23 likes this.
  16. cake23
    Offline

    cake23 Active Member

    Joined:
    Aug 10, 2015
    Posts:
    124
    Minecraft User:
    TheEnd
    Ohh :c But thanks!

Share This Page

Advertisement