getting all melon blocks in a claim

Discussion in 'Spigot Plugin Development' started by Xocky, Jul 5, 2018.

  1. how do you get all melon blocks in a faction claim
     
  2. are you using an API?
     
  3. Get the claim location (chunk) and loop from Xminx-Xmax, 256-1, Zmin-Zmax. If the block is a melon block add it to a list.
     
  4. Can you post the code?
     
    • Winner Winner x 1
  5. I'm not sure I can... Google might can though: check
     
  6. Mhh how do i get the claim locations?
     
  7. Using Factions API you should be able
     
    • Like Like x 1
  8. I know that but i can't figured out how to use the factions api to get the claim location
     
  9. In the website you downloaded the faction plugin it should show how the API works and what you can use.
    You can see how to search like so. It takes almost 10 seconds to find it.
    Code (Java):
    Faction faction = BoardColl.get().getFactionAt(PS.valueOf(player.getLocation()));
    boolean isInFaction = faction != null && !faction.isNone();
     
    #9 darklazerog, Jul 6, 2018
    Last edited: Jul 6, 2018
  10. dude i meant how do you get the faction's claim location
     
  11. Take a look at this thread. Please try googling your issues before making a post here. 90% of posts are always dupes.