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

Radius Particle and Player Heart +(HELP)

Comments in 'Plugin Development' started by Seetch, Jul 6, 2015.

?

You know well PocketMine-MP API ?

  1. Yes, i'm know PM-MP API.

    80.0%
  2. No, i'm bad know PM-MP API.

    20.0%
  1. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    Hello, dear craftsmen! I recently learned php and started working with PM
    I'm began to develop an ambitious mini game, but I can not make somewhat things.


    Now I will try everything explain.


    In the mini game, there is a class Medic. I want to make to the class with a doctor when you click certain item around you to create Particle range within 5 blocks and who will be in this radius that was adding them to XP.

    I know this is possible to do ...
    CraftYourBukkit and LDX like this.
  2. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    PHP:
    foreach($this->getServer()->getOnlinePlayers() as $p) {
      if(
    $player->getLevel()->getName() == $p->getLevel()->getName() && $player->getPosition()->distance($p->getPosition()) <= $radiusAroundPlayerToHealPlayersIn) {
        
    // Heal $p
      
    }
    }
    CraftYourBukkit likes this.
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    How to set the Particles in a "circle" around the Player?
    hoyinm14mc, LDX and Legoboy0215 like this.
  4. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    full code, i'm stupid o_O
  5. Seetch
    Offline

    Seetch New Member

    Joined:
    Feb 5, 2015
    Posts:
    22
    Minecraft User:
    Seetch
    I just can not quite understand all the ... I hope someone can help ...
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Cache the squared radius and compare distanceSquared against radius square. It is faster in terms of performance since no square root is required to calculate the exact radius (with Pythagoras's theorem).
    iksaku and Xenturio like this.

Share This Page

Advertisement