Jump to content

How do I use the Worlds API?


Recommended Posts

Posted

Hey guys, I'm trying to hop worlds in my script, and I'm having a little bit of difficulty understanding the Worlds methods.

In specific, I'm confused about the parameter "all" for the method getAvailableWorlds

public java.util.List<World> getAvailableWorlds(boolean all)
Gets a list with all available worlds to hop to
Parameters:
all - True for all worlds, False to filter out worlds that are not allowed to be hopped to

What is it that all does? If I wanted to just get a list of all P2P, non PVP worlds what would I input?

 

Thanks in advance <3

Posted
3 hours ago, ThoughtVNC said:

Hey guys, I'm trying to hop worlds in my script, and I'm having a little bit of difficulty understanding the Worlds methods.

In specific, I'm confused about the parameter "all" for the method getAvailableWorlds

public java.util.List<World> getAvailableWorlds(boolean all)
Gets a list with all available worlds to hop to
Parameters:
all - True for all worlds, False to filter out worlds that are not allowed to be hopped to

What is it that all does? If I wanted to just get a list of all P2P, non PVP worlds what would I input?

 

Thanks in advance <3

all - True for a List all worlds, False to filter out worlds that are not allowed to be hopped to based on osbots criteria of a invalid world (pvp, high-risk, etc.)

 

List<World> w = getWorlds().getAvailableWorlds(true);

want to filter?
List<World> w = getWorlds().getAvailableWorlds(true).stream().filter(world -> world.isMembers() && world.isPvp()).collect(Collectors.toList());

 

  • Like 4
Posted
1 hour ago, Chris said:
all - True for a List all worlds, False to filter out worlds that are not allowed to be hopped to based on osbots criteria of a invalid world (pvp, high-risk, etc.)

 

List<World> w = getWorlds().getAvailableWorlds(true);

want to filter?
List<World> w = getWorlds().getAvailableWorlds(true).stream().filter(world -> world.isMembers() && world.isPvp()).collect(Collectors.toList());

 

Thanks, I appreciate it.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...