EssentialsX

EssentialsX

2M Downloads

API - Getting Homes Name From Location

TagCraftMC opened this issue · 2 comments

commented

Greetings EssX devs,

Would it be possible to get the home name via it's location?
Currently the only way to delete a home is via it's name #delHome(String);
However you can get a home via it's name or location which allows me to compare the location I have to a homes location.

It would be great if either #delhome(String) accepted a location as well as the string and/or I was able to get the name of the home via #getHome(Location).

Thanks.

//Shit Code Example
if (#getHome(Location) != null)
{
    //checks here
    //if true
    #delHome(Location);
    //or as an example
    #delHome(#getHome(Location).getName());
}
commented

If he doesn't add this, you could always loop trough all homes and check if the home's location is the same as your location

commented

^ is what you should do because that's what the implementation would end up being.