Trinkets (Fabric)

Trinkets (Fabric)

22M Downloads

onUnequip Is Unreliable In Creative Mode

sylv256 opened this issue ยท 3 comments

commented

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.

commented

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.

commented

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)
commented

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