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

get spawn protection number

Comments in 'Plugin Development' started by Radix, Jul 10, 2015.

  1. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Is there a way , I can get my plugin to read the server.properties and and find the spawn protection radius , and send a command while player exit that radious or re enter it! Ive be stuff for so long on this... Xode for this is very much needed and would help!
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $Server->getSpawnRadius()
    CraftYourBukkit likes this.
  3. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    How Could I use that with this?
    PHP:

    $player
    ->sendMessage("You have left spawn"); 
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    In player move event, compare to and from. If the distance from spawn is longer than the radius in to but shorter than radius in from, send the message.
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Example? IDK how to check distances...
    RekkuzaRage likes this.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Use the Pythagoras's theorem a²+b²=c². Though, PocketMine has implemented the theorem in the Vector3->diatance() and diatanceSquared() function.
  7. RekkuzaRage
    Offline

    RekkuzaRage Active Member

    Joined:
    Apr 15, 2014
    Posts:
    252
    Minecraft User:
    RekkuzaRage
    I suck at algebra...
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    But at least you should know what this is...
    RekkuzaRage likes this.
  9. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Could You show an example on how you would do it?
    RekkuzaRage likes this.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This is not algebra... This is very basic geometry. It is supposed to be taught at 13 years old in Hong Kong, but I understood it at 9 years old already. It is simply too simple. If you can't even understand that, give up to advanced programming.
  11. RekkuzaRage
    Offline

    RekkuzaRage Active Member

    Joined:
    Apr 15, 2014
    Posts:
    252
    Minecraft User:
    RekkuzaRage
    Isn't it related something to triangles? I remember learning about it in school, but didn't pay much attention to it.
  12. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Oooo, so I am not suppost to know it yet. IDK how to explain, because I learned that in Chinese.
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And what do two right-angled triangles make? A rectangle. What is the length of the diagonal of the rectangle? The hypotenuse of a triangle. What is it? The distance from one point to another point in coordinate geometry.
    Legoboy0215 likes this.

Share This Page

Advertisement