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

API 0.12.0 sender change?

Comments in 'Plugin Development' started by DevBrad, Apr 26, 2015.

  1. DevBrad
    Offline

    DevBrad New Member

    Joined:
    Feb 17, 2015
    Posts:
    15
    Minecraft User:
    DevBrad
    So I'm developing a plugin at the moment and I've just switched to API 0.12.0 and something is not right.
    Here's what I have:

    PHP:
    if ($sender instanceof Player) {
                        
    $pos $sender->getPosition();
                        
    $sender->sendMessage("Please tap a block to create a portal.".
                                                    
    intval($pos->getX()).",".
                                                    
    intval($pos->getY()).",".
                                                    
    intval($pos->getZ()));
                    } else {
                        
    $sender->sendMessage("[MCTeleport] Please run this command in-game");
    When I enter the command into the console it outputs "[MCTeleport] Please run this command in-game" as it should but it does the same when in-game. Please help.
  2. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Missing use pocketmine\Player?
    DevBrad likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why do you intval?
  4. DevBrad
    Offline

    DevBrad New Member

    Joined:
    Feb 17, 2015
    Posts:
    15
    Minecraft User:
    DevBrad
    Lol thanks man I always forget to do that.

Share This Page

Advertisement