@DevilWarriors
OK so you want the MOD to automatically support entities that give raw wood when they are mined!
This is good and I believe that you should keep this idea,
however the AussyBush and TreeSeeds MODs, provide examples of where your assumptions fall over.
While mining trees with either of these MODs installed (which still give 4 raw-wood to the player on being mined) your coding if item == "raw-wood" will trigger the "exploding" chainsaw code (else statement) rather than the true statement.
I believe that this is just a technical limitation for the chainsaw MOD due to the fact that the on.player_mined event returning a single item rather than an array of items, therefore any new MOD that will return raw-wood to the player but returns multiple items will also fail!
I believe that this is just a simple assumption mistake vs Factorio's internal logic
I think you need to reassess your assumption on what in Factorio would ever give raw-wood?
for me this is an entity of type tree!
if there are any others?, please tell me.
I have tried changing the order of item drops on my MOD, but this only solves half the problem as I can then mine trees with the chainsaw, but then the chainsaw will explode while mining saplings, which from an ideological perspective doesn't make much sense.
A chainsaw that can cut down Oak trees all day, but fails if it touches a leaf?