This is a list of things I had to figure out on my own in Fabric due to the lack of online documentation.
Don't use player.inventory.remove
!
//signature:
int net.minecraft.entity.player.PlayerInventory.remove(Predicate<ItemStack> shouldRemove, int maxCount, Inventory craftingInventory)
Note the craftingInventory
parameter: I have no idea how to get the player's crafting inventory, and passing null
makes the command throw.