game-common / pragma.inventory / InstancedItemPlugin / onDelete /

onDelete #

open fun onDelete(deletedItem: InstancedItem, instancedSpec: InventoryContent.InstancedSpec, inventoryContent: InventoryServiceContent, startingInventory: InventoryData, pendingInventory: InventoryData): InventoryModifications

Called any time an instanced item is being deleted. This plugin allows chaining of additional item operations from the delete event.

Used By

  • InventoryService.storePurchaseV4 - when cost includes an instanced item
  • InventoryServie.craftV1 - when cost includes an instanced item
  • InventoryService.applyInventoryOperationsOperatorV1
  • InventoryService.applyInventoryOperationsPartnerV1
  • InventoryService.applyInventoryOperationsServiceV1
  • InventoryService.matchEndV4
  • Any chained delete inventory operations returned from InstancedItemPlugin.newInstanced and InstancedItemPlugin.update and StackableItemPlugin.onUpdate

Parameters #


The Instanced Item that is being deleted.


The Instanced Spec definition from the catalog.


InventoryServiceContent object used to reference all the content specs.


InventoryData - object that contains all the player’s instanced and stackable items.


InventoryData - object that contains the current in-flight representation of a player’s instanced and stackable items.