Jump to content

"Farm" Action Type Does Not Work

Pending 2.1.23

Terceran
Terceran

Posted

I wanted to award 1 xp each time a player picked a farm or wild plant, and could not find a great way to do so. I wound up going into the code and replacing the OnGrowableGathered hook with the following:

private void OnGrowableGathered(GrowableEntity growable, Item item, BasePlayer player)
{
if (growable == null || item == null || player == null || player.IsNpc)
return;

AddXPFromLoot(player, LootSettings.LootType.Farm, "farm_crop", 1);
}

And then I also added this to the JSON config file:

{
"Enabled": true,
"Item/Entity Shortname": "farm_crop",
"Action Type": "Farm",
"XP Amount": 1.0
}

...and all was well. If you could please implement something like this and/or get the Farm action type working, I'd appreciate it immensely. You defined it in your enum, but never used it. Thanks, it's otherwise a terrific plugin.

MeventSupport

Posted

On 5/23/2026 at 6:45 AM, Terceran said:

I wanted to award 1 xp each time a player picked a farm or wild plant, and could not find a great way to do so. I wound up going into the code and replacing the OnGrowableGathered hook with the following:

private void OnGrowableGathered(GrowableEntity growable, Item item, BasePlayer player)
{
if (growable == null || item == null || player == null || player.IsNpc)
return;

AddXPFromLoot(player, LootSettings.LootType.Farm, "farm_crop", 1);
}

And then I also added this to the JSON config file:

{
"Enabled": true,
"Item/Entity Shortname": "farm_crop",
"Action Type": "Farm",
"XP Amount": 1.0
}

...and all was well. If you could please implement something like this and/or get the Farm action type working, I'd appreciate it immensely. You defined it in your enum, but never used it. Thanks, it's otherwise a terrific plugin.

Thanks for the info and for sharing your solution.

We’ll look into it and try to find the best way to properly  support this  in a future update.

 

Appreciate it!

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.7m
Total downloads
Customers
11.5k
Customers served
Files Sold
164k
Total sales
Payments
3.5m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.