Jump to content

[1.18.2] Variable not syncing or doing what its supposed to do after reloading world


Crescentine

Recommended Posts

Hi there, I am trying to make the tanks in my mod require fuel in order to move. I've done this by requiring in order to be controlled by rider (extending PigEntity) they need to have fuel > 0. I have a function set up to print out the amount of 'fuel time' left, that is working as intended. It shows that even when there is plenty of fuel (meaning fuel > 0) it is not syncing up with the stuff allowing the entity to move, and as a result it cannot move. 

I had a hard time describing this, I can clarify if needed. 

 

Yes, I am saving it to the entity's nbt

 

The class (parent to all the entity classes in the mod) the problem is in: 

https://pastebin.com/BFNSKzsm

Github Repository of the Mod

https://github.com/Crescentine/Trajans-Tanks-1.18 

Link to comment
Share on other sites

8 hours ago, Crescentine said:

it is not syncing up with the stuff allowing the entity to move

entity moving is client side, you should use an EntityDataAccessor to sync the data,

you can take a look at the vanilla Entities for how to use it

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.



×
×
  • Create New...

Important Information

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