Jump to content

[1.15.2] How to test if a player is in a dimension


FossilFind

Recommended Posts

In the PlayerTickEvent I want to test if the player is in my custom moon dimension and change the gravity but nothing I have tried has worked. I noticed that some things I tried would work but when I change dimensions either with /forge command or teleport function, the gravity would be the same as the dimension I came from. When I re logged it worked though.

Link to comment
Share on other sites

Because the server and the client may not be running on the same physical side you need to use networking. Forge does a lot of the work for you, see the official documentation: https://mcforge.readthedocs.io/en/1.15.x/networking/

You need to have the logical server send a message and then have the logical client receive that message and do whatever it needs to as a result (in this case change the gravity).

Also, the functionality that you are describing sounds quite similar to Galacticraft. You might want to to a look at their code for a reference:

https://github.com/micdoodle8/Galacticraft

Edited by jdawg3636

Website: jdawg3636.com
Discord: discord.gg/EKeM7Jz

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.