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.

Featured Replies

Posted

Hey folks,

 

I have an item that I store inside an inventory of my IEEP.

I need to have that item synchronized at all time because I am calculating values for custom gui rendering from its durabilty.

The problem is that right now it is only synchronized when I open the container where I use this item.

How can I force this item to update , I could use a custom packet but I feel like minecraft must have a built in way I dont know about.

 

Greetz Failender

I was sure that item updates occurred on both Client and Server.

Anyways, if you're trying to do what I think you're trying to do, you can always subscribe to LivingUpdateEvent and manually call the update. I found that IEEP doesn't always have the same values on client as server. (Maybe it does, and I'm just not using it correctly) But when my player first joins the world, I sync them once, and updates run on both sides.

With all due respect, sir: I do, what I do, the way I do it. ~ MacGyver

  • Author

I am damaging the items on server side (they are a energy storage and im usign damage values to check out how much energy is left) .

I am rendering the energy left on client side which means I need the damage value on client side.

But its not getting synced by default, because its not in a opened container.

Which means I need to force the update. The question is not the where, the question is the how.

So my question is has vanilla a built in way to synchronize itemstacks I can use.

If I remember when an item receive a "damage change" it normally autosync client and server (normally in mc methods who return an itemstack).

 

But I can't imagine what you want without looking the item class or something more (GUI images, Container, ... ). "Probably" you are applying something much complicated without necessity. =/

 

// In my mod generally, when I start to make an idea of item or system, I look for something similar on Minecraft and try to make a "near concept" to after make the system like I planned.

// BSc CIS, hardcore gamer and a big fan of Minecraft.

 

TmzOS ::..

  • Author

Exactly. It does that using detectAndSendChanges.

So. Is there a good way without detectAndSendChanges? I could of course also use a custom packet, but I feel like there must be another way

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.