DespawnConfig

Configurable despawn times for dropped items, and base backpack despawn times on your configuration.

Total Downloads: 1,462 - First Release: Jun 2, 2017 - Last Update: May 23, 2018

5/5, 9 likes
  1. yes I am having the same issue...any way to make certain items never despawn?
     
  2. I didn't find a way to have this plugin ignore certain items, aside from setting a really high timer on the items you want. By default the plugin insta-despawns the blue/green/red access cards because it derives the despawn timer times for the card as 0 minutes.

    You could try the following modifications, to 'ignore' certain items with a negative despawn timer:

    Code:
            void SetDespawnTime(DroppedItem item)
            {
                if (item == null)
                {
                    return;
                }            if (item.IsDestroyed)
                {
                    return;
                }            float despawnTime = settings.Instance.GetDespawnTime(item.item);            if (despawnTime >= 0)
                {
                    item.Invoke(new Action(item.IdleDestroy), despawnTime);
                }
             
            }        void SetDespawnTime(DroppedItemContainer container)
            {
                float despawnTime = container.inventory.itemList.Max(x => settings.Instance.GetDespawnTime(x));
                if(despawnTime >= 0)
                {
                    timer.In(1f, () => //Time to make sure that despawn time isnt reset by the float.max value
                    {
                        container?.ResetRemovalTime(despawnTime);
                    });
                }
            }
    And in your config:
    Code:
        "keycard_blue": -1.0,
        "keycard_green": -1.0,
        "keycard_red": -1.0,
     
    Last edited by a moderator: Jul 16, 2018