ChangeInventoryEvent

Everything that happens seems to be one action behind: If I pick up an item from slot 43, it says 0, next time if I pick up an item from slot 44, it says 43, and if I pickup an item from slot 78 it says 44. What’s happening here??

What does? What is the code you are running?

When I log the SlotIndex.getValue(), it gives me the previous slot id.

This is the code I have, I’m using api 7.0.0

 @Listener(order = Order.LAST)
    public void ChangeInventoryEvent(AffectSlotEvent e){
        Optional<SlotIndex> si = e.getTransactions().get(e.getTransactions().size()-1).getSlot().getProperty(SlotIndex.class, "slotindex");
        if(si.isPresent() && si.get().getValue()==44)
            e.setCancelled(true);
    }

Though I’ve got it sort of figured out… It only seems to work in survival…