Throw a rock, Cannot erase the fallen rock.Solved

I am a beginner who recently started developing plugins for RUST.
In the plugin I am currently making, I really want to erase the thrown rock, but it doesn’t work.
Does anyone know how to erase a thrown rock?

void OnPlayerAttack(BasePlayer attacker, HitInfo info)
{
    // throw rock!!!
    var heldItem = attacker?.GetActiveItem() ?? null;
    if (heldItem != null)heldItem.RemoveFromContainer(); 
    // The rock continues to exist forever without disappearing.....
}
void OnMeleeThrown(BasePlayer player, Item item)
{
    item.Remove();
}


You are trying to remove a stone after hitting something, and you are trying to grab an item that is not currently in the player's hands.

Thank you, ArtiIOMI. Thanks to you, I was able to achieve my goal.

Merged post

@ArtiIOMI 
Please watch this video. I did an experiment.
It seems that when a stone is thrown far away, only the 3D object remains. Why is that…?”



        void OnMeleeThrown(BasePlayer player, Item item)
        {
            Message(player, "OnMeleeThrown");
            Message(player, item.skin.ToString());
            Message(player, "rem");
            item.Remove();
        }
jerkypaisen

Thank you, ArtiIOMI. Thanks to you, I was able to achieve my goal.

Merged post

@ArtiIOMI 
Please watch this video. I did an experiment.
It seems that when a stone is thrown far away, only the 3D object remains. Why is that…?”



        void OnMeleeThrown(BasePlayer player, Item item)
        {
            Message(player, "OnMeleeThrown");
            Message(player, item.skin.ToString());
            Message(player, "rem");
            item.Remove();
        }
Probably client-side visual issues. Item removed on the server side, but the client still sees it.

Merged post

Try 

item.DoRemove();

@ArtiIOMI 
By specifying 2f as an argument in the method you first taught me, I was able to erase the thrown stone!

item.Remove(2f);

but, I don’t understand the meaning of this 2f, is there any information available?
How do you get method information? There’s nothing like MSDN, right?

Thank you for your advice.

.Remove(TIME) jak szybko musi usunąć.

Use .Net Decompilator on Assembly-Csharp file.

Thank you for your advice.

Locked automatically