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

Ok, so I am the author of Damage Indicators mod, and the client side health really benefited the mod as now a server mod is not needed, HOWEVER, some extras i threw in due to the server mod being previously required have been problematic. One being potion effects.

 

When a living entity has a potion effect applied, a formula is applied to combine the colors of all current potion effects and applied to the datawatcher server side, which is then later delivered to the client, and I have deemed data extraction from this as not viable, as colors are somewhat generic and do not give details on exactly the strength duration etc of the potion effect, IF the generic effects could actually be accurately extracted.

 

However, i have noticed that when a mob is first spawned via a chunk load, the client side actually receives the exact potion info, although it is never  updated again. Does anyone know a way the client side might force the server to resend the initial spawn packet on demand? Is there a spawn info request packet, or is the initial spawn data packet sent only when the server wants it to? Any info on this would be much appreciated and would save me days of logic following.

  • Author

That method is protected, and on top of that, would not do anything client side.

Iterator iterator = this.activePotionsMap.keySet().iterator();

        while (iterator.hasNext())
        {
            Integer integer = (Integer)iterator.next();
            PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.get(integer);

            if (!potioneffect.onUpdate(this))
            {
                if (!this.worldObj.isRemote)
                {
                    iterator.remove();
                    this.onFinishedPotionEffect(potioneffect);
                }
            }
            else if (potioneffect.getDuration() % 600 == 0)
            {
                this.onChangedPotionEffect(potioneffect, false);
            }
        }

On the client side, activePotionsMap never changes from what it is when the mob originally spawned. So running this client side would not really do anything.

  • Author

Ok, I stand corrected. I didn't check when the Packet41EntityEffect got send, and it's really only once in the "spawn packet" (multiple actually).

I don't see any way of getting all information about the potions to the client without modding the server.

Thanks for trying anyways, and yeah I am aware of this :(. I was hoping someone might know of, or have a stroke of genius and might give me a hint on how I might coax the Packet41EntityEffect out of the server, client side, on demand.

  • Author

Client can then compute the data however you want.

No, because when the entity receives a new potion effect, the server only tells the client the new particle color, not the entire potion effect.

 

Well actually, the potion color is updated, but is not extractable into anything useful. The issue is, a mobs REAL potion effect is only applied when spawned, so if any potion effects change after spawning, it will never apply client side, only a particle effect is applied(which is a color set on the datawatcher server side) which as i said, cannot be used to accurately tell detailed information about the potions applied.

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.