Jump to content

How to hop worlds if player is in an area


Recommended Posts

Posted

Hello,

(I don't see logic that would get the player to that spot or out of that spot. so thats why it will forever loop)

Your logic goes like this.

You are in the spot -> you are a player -> will hop...

Try this 

   if (getPlayers().getAll().stream().anyMatch(s -> s != myPlayer())){
       
       hop
   }


 

 

 

 

Posted
44 minutes ago, Nbacon said:

Hello,

(I don't see logic that would get the player to that spot or out of that spot. so thats why it will forever loop)

Your logic goes like this.

You are in the spot -> you are a player -> will hop...

Try this 


   if (getPlayers().getAll().stream().anyMatch(s -> s != myPlayer())){
       
       hop
   }

So I wanted my player to hop worlds if someone was on a certain tile or area because the people in this area steal all the ore. Is that what this is doing?

 

 

 

 

Posted (edited)
22 minutes ago, Lucas_Larson said:

So I wanted my player to hop worlds if someone was on a certain tile or area because the people in this area steal all the ore. Is that what this is doing?

This says if there is a player in the general area(my fault)

  Area miningArea =new Area(1,1,1,1);
        if (getPlayers().getAll().stream().anyMatch(s -> s != myPlayer() &&miningArea.contains(s))){

            hop
        }

 

Edited by Nbacon

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...