swapItemStack

public abstract void swapItemStack(@NotNull() @NotNull() ItemStack oldItem, @NotNull() @NotNull() ItemStack newItem, @NotNull() @NotNull() Inventory inventory)

Replaces an item in an inventory

Parameters

oldItem

The item to be replaced

newItem

The item that should replace oldItem

inventory

The inventory which this is happening at