1. As the title asks, is there an event to detect when an item is going to be deleted because it was abandoned on the ground for too long ?
     
  2. Not sure about some timer or message, but there is console (rcon) command to set time before despawn

    Code:
     server.itemdespawn 180
    This is the default time (3 mins to item despawn after throw on ground) you can set it via console(rcon) to any time yu want, just it needs to be in seconds! also its not persistant command, after server restart it will be back to default 180 sec (3 mins) so you need to use timed execute to run it after restart or put it in cfg file (not sure about cfg file, maybe somebody else could confirm this - I am running it via TimedExecute after each restart)
     
  3. Would that plan make sense :
    - detect dropped item, add it to a "dropped items" list
    - remove it from the list if someones pick it up
    - periodically check if the item still exists (if not it has despawned and use it to do code accordingly)

    Also im new to this and im a little confused by the api documentation : all the events are listed, but no basics like accessing position of an entity, manipulating inventories and so on ... did i miss something ? is there documentation on that ?
     
  4. Bump,

    ****How to know when a human corpse or item is despawned/killed/destroyed/removed? Is there a hook?****

    I tried watching OnEntityKill(BaseNetworkable net) but really mostly saw animal corpses and barrels/crates being killed
     
  5. Any dropped item will create a worldobject as "WorldItem". This object has also the class "DroppedItem".
    Once its dropped, it runs an invoke "IdleDestroy" based on the the server setting for despawn:

    Code:
    // DroppedItem
    private void IdleDestroy()
    {
        if (this.item != null)
        {
            this.item.Remove(0f);
            this.item = null;
        }
        base.Kill(BaseNetworkable.DestroyMode.None);
    }
    The called "Kill" function here does include the hook "OnEntityKill".
    In this hook you could check for if the object is either a "WorldItem and/or "DroppedItem".
    Afterwards you could do anything you want to do with it.
     
  6. Does this command work on Vanilla servers? Just type in new time in seconds in RCON then server.writecfg?
     
  7. writecfg does not save this automatic. You need to add it to your server.cfg manually to be autoset at startup
     

  8. Thank you.