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

hello, i want code for................

Comments in 'Plugin Development' started by XWITHERHEROX, Dec 12, 2015.

  1. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    hello, i want code like
    if i do /dos
    his teleport me 10 blocks up
    If you understand me
    pleace help :) !
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Didn't you or someone else already made a post about this? Just read the answers. This is so easy to do, you should learn the API again(if you even looked at it before posting this thread).
    PHP:
    $player->teleport(new Vector3($player->x$player->10$player->z));
    While $player, of course, is the Player you want to teleport.
    cake23, iDirtPlayzMC and XWITHERHEROX like this.
  3. DevWars
    Offline

    DevWars Banned

    Joined:
    Nov 7, 2015
    Posts:
    28
    Minecraft User:
    PmServer
    Good Boy !
    XWITHERHEROX likes this.
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Why? Position extends Vector3 and well, he wants to teleport the Player 10 Blocks above him, which means it's in the same world, so I don't see any reason of using Position. Also, you should take a look at this.
    cake23, HotFireyDeath, Primus and 4 others like this.
  5. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Also.. From the title..
    Heres the code for "...........":
    $this->getLevel()->getServer()->broadcastMessage("............");
    minebuilder0110 likes this.
  6. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    PHP:
    $this->getLevel()->getServer()
    ?
    HotFireyDeath and Primus like this.
  7. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    We'll you just made yourself look bad. That code doesn't even make sense.
    This is correct:
    PHP:
    $this->getServer()->broadcastMessage("....");
  8. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Not really. I added getLevel() because $this was a Block. (Position). So my code actually is correct.
    Last edited by a moderator: Dec 13, 2015
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And why would you use a totally irrelevant context here? Normally when we mention $this we refer to a PluginBase context, because that's the context we implicitly assume because this is a plugin development forum. Why are you using Block context in this case, and for no relevance at all except to get a chance to mention ImagicalMine?

Share This Page

Advertisement