Ignoring slot transaction on InventoryMenu during EntityTickContext

SpongeForge: 1.16.5 latest

  1. The problem is in the modification or in the sponge?
  2. If the problem is modification, then how should I perform these transactions?

Some code would be nice.

But based on what you sent. My guess is your doing the transaction in the same tick as the event/command.

Just schedule the transaction for the next tick

I think problem in this code

  @Override
  public boolean start() {
    Optional<MagazineLocation> result = this.findMagazine(this.getPerformer());
    if (!result.isPresent()) {
      return false;
    }

    this.magazineLocation = result.get();
    this.newMagazineStack =
        this.magazineLocation.itemHandler.extractItem(this.magazineLocation.slot, 1, false);

    return super.start();
  }

Full class - crafting-dead/MagazineReloadAction.java at 1.16.x · nexusnode/crafting-dead · GitHub

Ah you should had said that your not using SpongeAPI but instead Forge code.

Im guessing now its a conflict between this mod and sponge that your attempting to fix?

Yes I am trying to fix this conflict

In that case im less useful. Your best bet is reporting it on the Sponge github as those are the developers who actually make Sponge Forums and know best.

Well, thank you. I hope to be able to fix it.