OnEntityDeath and OnEntityTakeDamage hook don't see treesSolved
I try to use OnEntityDeath or OnEntityTakeDamage to my plugin, but this hooks don't catch trees.
OnEntityKill work properly, but it don't have information about who kill, and I need to know.

About my plugin: is for add some realism to Rust. When player is cut the tree, plugin create dead log.
Problem: when admin/server destroys a tree, it captures the OnEntityKill trigger and we don't know who it kills the player or the server.
The reason these hooks are not called is because trees are not and do not inherit from BaseCombatEntity. However it calls OnEntityKill because it does inherit from BaseNetworkable. You could try using another hook to see if you can instead store the last player to hit the tree or something, however that could end up with a lot of data being stored.
Then only OnPlayerAttack can help, but how to get last damage amout?
You can get it in the HitInfo.
5f542b9181eac.png 0x89A
You can get it in the HitInfo.

Health() show only last hp before hit.
damageTypes.Total() always 0 if attack tree.
I try NextTick/NextFrame, but it is too heavy a burden for them.

Try using OnEntityTakeDamage(ResourceEntity entity, HitInfo info)
5f542b9181eac.png 0x89A
Try using OnEntityTakeDamage(ResourceEntity entity, HitInfo info)
Thanks a lot.
I have some problem with duble trigger OnEntityTakeDamage(ResourceEntity entity, HitInfo info) 
But everything else works good. :)

Merged post

I find out why  OnEntityTakeDamage(ResourceEntity entity, HitInfo info) is trigger two times.
First time is when entity take damage, secound when is dieing.

Again thanks a lot @0x89A
You are life saver.

Merged post

I figured*
(How to edit post?)
Never really thought much about tree damage.  But an 'invincible trees' mod could be fun.  It would be like legacy Rust.
Locked automatically