Solved Getting MPlayer from radius.

Discussion in 'Plugin Development' started by tlm920, Jul 29, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    tlm920

    Hi everyone!

    (The faction plugin i'm using is the MassiveCraft one)
    I am developing a plugin with classes and I am creating class called enchanter; this class gives you a gold hoe. When you hold the gold hoe it should give faction members in a radius, an effect.

    tl;dr: I would like to know how I could get faction members from a radius, and heal them.

    Any help is appreciated. I'm sure I am being dumb and this is really easy to do. :oops:
     
  2. Offline

    Machine Maker

    So, Entity have a getNearbyEntities method. Then loop through those entities and filter out non-players. Then you can use the MassiveCraft API (the link you provided shows you how) to check which faction they are in. If they are in the correct one, boom. You can heal them.


    EDIT: This is assuming you know how to make a plugin. If you don't it will require more explanation. (And you probably watching YT videos to learn the basics).
     
    tlm920 likes this.
  3. Offline

    tlm920

    Ill try this out @Machine Maker :D
    Thanks for replying so fast...

    EDIT: It worked, sorry for such a delayed response. :p
     
    Last edited: Jul 31, 2019
Thread Status:
Not open for further replies.

Share This Page