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

What is the code to find the position of a block?

Comments in 'Plugin Development' started by Legomite, Feb 17, 2014.

  1. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    What is the code to find the position of a block?
  2. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    Hmmm, I'll have to think on that one.
  3. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    $x = $data["target"]->x;
    $y = $data["target"]->y;
    $z = $data["target"]->z;
  4. D4NRY4N
    Offline

    D4NRY4N New Member

    Joined:
    Feb 15, 2014
    Posts:
    2
    Minecraft User:
    Danny
    Sorry to hijack your thread, however my question is related

    If i wanted to return the position of the player, would the code be?
    $x = $data["player"]->x;
    $y = $data["player"]->y;
    $z = $data["player"]->z;

    thanks
  5. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    IDK. Im a new to amateur coder. I only started in october and im only 12
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Player does not have the coordinates fields. You should use its entity object.
    A Block object and an Entity object are also subclasses of Position, so they must contain fields of x, y, z and level

Share This Page

Advertisement