Making non-consumable items consumable?Solved
So im making plugin that uses some items with skins and i would want to make it so i can consume items you normally can't. Is that even possible? I have tested many hooks without results. Please help :) i have metabolism system ready for this. If it was food item i could just use
void OnItemUse(Item item, int amountToUse)​

but those items have weird descriptions and it seems that you can't change them.

Pretty simple fix :/

    {

        int amount = 0;

        private void OnActiveItemChanged(BasePlayer player, Item oldItem, Item newItem)
        {
            var item = player.GetActiveItem();
            if (item == null) return;
            if (item.info.shortname == "glue")
            {
                HeldEntity heldEntity = player.GetHeldEntity();
                if (heldEntity != null)
                {
                    heldEntity.SetHeld(false);
                    heldEntity.SendNetworkUpdate();

                }
                if (player.inventory.GetAmount(-1899491405) > amount)
                {
                    player.inventory.Take(null, -1899491405, 1);
                  
                }
                else
                {
                    player.ChatMessage("Nope");
                }
            }
        }
    }
Locked automatically