Access the User who's dropping an Item

Hey,

i want to know who drops items in their base...

There is already the "OnItemDropped" Hook, but i dont really know how to access the userId of the user who dropped the item.

Regards

SeaLife :)

var player = item?.GetOwnerPlayer();

Hey, i already had that Idea - this only works if a player drops the item from his inventory but not from an open box - thats what i need.

GetOwnerPlayer() is null in the case described above. :/

 

Regards

Hey, this also does not work if you only drop a single item of a stack by dragging it with rightclick + item.GetOwnerPlayer() is also null.

The name of the hook suggest, it will also be called if i split a stack in the same container without even dropping it?

 

I've to check that, but this is my suggestion, i dont have time now to test that...

You'll have to track that in your plugin. You can try OnItemDropped and OnItemAddedToContainer to also test for possible destinations, checking for a source player each step.