Okay, first of all thank you for the answer.
To test the function I wrote an infinite loop and if there are no more skinnable mobs near the bot he should write sth into the log. I positioned the bot next to some skinnable corpses and started the bot. Seems like he doesnt find any skinnable mobs since he just writes the message over and over again into the log, doesnt matter how many skinnable corpses are next to him :/