Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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 

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.