Jump to content
Lucas_Larson

How to hop worlds if player is in an area

Recommended Posts

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
   }


 

 

 

 

Link to post
Share on other sites
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?

 

 

 

 

Link to post
Share on other sites
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
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...