Get owner of item dropped with middle mouse?Solved
Today I found out you can drop item by useing middle mouse which splits half and drops the item. Im using the hook
OnItemDropped and works fine if the player drops the item like normal but if they drop the item using middle mouse I have no idea how to get the player who dropped it. 
I have tried
item.GetOwnerPlayer();
entity.creatorEntity
entity.OwnerID

but they all return null
Thanks in advance
 
Alternatively can I block this action?
I can't drop with the middle mouse. Maybe I just need a new mousr :) Anyway you can try this...

object OnItemAction(Item item, string action, BasePlayer player)
{
if (action == "drop") Puts($"{player.displayName}");
return null;
}

You can block dropping by returning non-null value. Don't forget to filter that only for dropping. Otherwise eating etc. will be blocked as well.
Hey Ultra. So unfotunatly that doesnt work. I was reading the code and it makes no sense to me. When middle mouse dragging items out of your inventory it triggers the hooks in this order
OnItemAction
OnItemSplit
ItemDropped
So essentially it goes. Item action dropp. Item is split. half is returned and then call item dropped hook.
Reading the code it seems that way
:(

Merged post

This is the code in the playerInventory class where item action is called. Maybe your see what i mean
if (itemUid == null || Interface.CallHook("OnItemAction", (object) itemUid, (object) command, (object) msg.player) != null || (itemUid.IsLocked() || !this.CanMoveItemsFrom(itemUid.parent.entityOwner, itemUid)))
      return;
    if (command == "drop")
    {
      int split_Amount = itemUid.amount;
      if (msg.read.Unread >= 4)
        split_Amount = msg.read.Int32();
      this.baseEntity.stats.Add("item_drop", 1, Stats.Steam | Stats.Life);
      if (split_Amount < itemUid.amount)
        itemUid.SplitItem(split_Amount)?.Drop(this.baseEntity.GetDropPosition(), this.baseEntity.GetDropVelocity(), new Quaternion());
      else
        itemUid.Drop(this.baseEntity.GetDropPosition(), this.baseEntity.GetDropVelocity(), new Quaternion());
      this.baseEntity.SignalBroadcast(BaseEntity.Signal.Gesture, "drop_item", (Network.Connection) null);
    }
    else
    {
      itemUid.ServerCommand(command, this.baseEntity);
      ItemManager.DoRemoves();
      this.ServerUpdate(0.0f);
    }​
Locked automatically