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

block break coordonate

Comments in 'Plugin Development' started by Asparanc, Feb 25, 2015.

  1. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    How can i get the coordonate of the block who was break by the player ?
    Praxthisnovcht likes this.
  2. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Please give example.
    Praxthisnovcht likes this.
  3. Potato
    Offline

    Potato New Member

    Joined:
    Jan 22, 2015
    Posts:
    10
    Minecraft User:
    Tyler_Tot
  4. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Praxthisnovcht likes this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Decompile it.
  6. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Ok :)
    Praxthisnovcht likes this.
  7. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Before see it i think it's
    $event->getBlock()->getX();
    Praxthisnovcht likes this.
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Correct. However, most of the time you don't need to use getX() because the Block returned by getBlock() already represents the whole coordinates, so you can just save the Block directly, rather than separating getX().
    Praxthisnovcht likes this.
  9. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    :)
    I just want save the coordinates in $x $y and $z
    Praxthisnovcht likes this.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    How do you want to use it?
  11. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Something:
    -Save it in file.yml ( one part of my plugin)
    -Set map protection ( if $x >100 $event->setCancelled(true) for exemple)
    Praxthisnovcht likes this.
  12. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    701
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Thank , I did not know xD
  13. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    x) you know that now :)
    Praxthisnovcht likes this.
  14. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    701
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Yes we always learn: p
  15. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You need to separate xyz fire the save, but not for other uses.
  16. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    i know :) getX() getY() and getZ()
    Praxthisnovcht likes this.

Share This Page

Advertisement