I am trying to catch the event when someone collects resources (Chopping wood, mining or picking up plants).
As far as I can read from the docs,Would be my method of choice. However, this is not firing at all when I am chopping wood (didn't try the other two). Why is that?Code:void OnDispenserGatherGather(ResourceDispenser dispenser, BaseEntity entity, Item item)
Thanks
Solved OnDispenserGather doesn't fire
Discussion in 'Rust Development' started by [wRECK] Enth, Oct 1, 2015.
-
Wulf Community Admin
I don't see anything that changed with it, but we'll take a look.
-
There's a typo in your method name, it should be OnDispenserGather (not OnDispenserGatherGather). This method is called for collecting from Trees, Rocks, and dead animals (including human meat etc, but not looting them).
For the Quarry and the Oil Pump, the method is OnQuarryGather(MiningQuarry quarry, Item item). The core difference is that the resources don't go directly to the player, but rather into a loot bin.
Gathering from plants (or small rocks and wood) does not call either of these. I assume these trigger the item pick up event instead. -
Wulf Community Admin
-
Yep, that was the issue. Thanks