Posted July 24, 20205 yr 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.
July 25, 20205 yr 2 hours ago, FossilFind said: When I re logged it worked though. That's an issue with synchronization. Whatever data you are calling is not synced to the client most likely. Read up on sides.
July 25, 20205 yr Author I change a static variable in the LivingEntity to change the gravity so I'm guessing it's only changing on one side. How would I change it on both sides?
July 25, 20205 yr 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 July 25, 20205 yr by jdawg3636 Website: jdawg3636.com Discord: discord.gg/EKeM7Jz
July 26, 20205 yr Author I've been messing around with Networking and I have no idea what i'm doing. Edited July 26, 20205 yr by FossilFind
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.