This object is in archive! 

[MODAPI] Add event to IMyPlayer to invoke when consume a item

ogrimdooh shared this feedback 3 years ago
Not Enough Votes

I'm developing a mod, and I miss an event to be called when a player consumes an item, in the IMyPlayer class containing the definition of the consumable used.

This will allow a lot of iterations with the player with consumables.

Replies (2)

photo
1

I managed to find a way to do it.

If anyone else has this problem, here's how I solved it.

Inventory = player.Character?.GetInventory() as MyInventoryBase;

Inventory.ContentsRemoved += Inventory_ContentsRemoved;

photo
1

This seems to've been added, MyAPIGateway.Players.ItemConsumed

Leave a Comment
 
Attach a file
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!
You can't vote. Please authorize!