Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onUnequip Is Unreliable In Creative Mode #273

Open
sylv256 opened this issue Aug 21, 2023 · 3 comments
Open

onUnequip Is Unreliable In Creative Mode #273

sylv256 opened this issue Aug 21, 2023 · 3 comments

Comments

@sylv256
Copy link

sylv256 commented Aug 21, 2023

Hello. I'm having issues with Phonochat and Trinkets causing it to duplicate the Phonochat Microphone. I'm unsure if this is a bug on my end or if Trinkets is causing this.

Steps to reproduce

  1. Put a Phonochat Microphone in the Microphone slot.
  2. Take it out of the Microphone slot.
  3. Leave the world and rejoin.
  4. See inventory.

Note that on a dedicated server, the duped item doesn't appear, but it acts as if it were always equipped. Additionally, this bug only triggers while in Creative Mode.

@sylv256 sylv256 changed the title Dupe Item Every Other Time When Unequipped onUnequip Is Unreliable In Creative Mode Aug 21, 2023
@sylv256
Copy link
Author

sylv256 commented Aug 21, 2023

We could possibly make it so the client syncs trinkets with the server in the creative inventory?

@TheRealWormbo
Copy link

Can confirm with Fabric Botania in 1.20.1: Unequipping e.g. a Ring of the Mantle (which gives Haste 2 while the player has mana) doesn't reliably stop the player from having Haste 2. After adding appropriate logs, I could see that the unequip event was sometimes only called on the render thread, not the server thread.
Only happens in Creative mode. Survival mode (or Forge Botania, which uses Curios instead) works fine.

@cech12
Copy link

cech12 commented May 11, 2024

Can confirm that, too. (1.20.4 - 3.8.1) My mod Useful Hats (1.20.4 - 5.1.1.1) relies on the Trinkets onEquip/onUnequip method and adds some effects to the player when equipped. But in creative mode the onUnequip method is called only nearly every second time (serverside). Clientside seems to work good.

Reproduction:

  • put a Shulker Helmet into the Hat slot (creative mode)
  • Levitation effect shows up
  • remove the helmet from the slot (the effect should be removed, but that does not happen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants