Farmer's Delight

Farmer's Delight

95M Downloads

[1.18.2] Requesting a config list for straw harvestable blocks

DarkYuan opened this issue ยท 2 comments

commented

Description
Breaking grass-like blocks like BYG's prairie grass doesn't drop straw with knives

Steps to reproduce:

  • Install "Oh The Biomes You'll Go"
  • Break prairie grass or tall prairie grass with any knife

Expected behavior:
Straw should drop. I'd suggest a config list of blocks to drop straw when broken with a knife, or a block tag like #farmersdelight:straw_harvestable (or even better both, a config that lists the tag as well as room for additional ids or tags)

Logs
https://gist.github.com/DarkYuan/16d9bcef166444c9f3f8e9aa3b60d8fb#file-latest-log

Screenshots
image

Mod list:
https://gist.github.com/DarkYuan/16d9bcef166444c9f3f8e9aa3b60d8fb#file-crash-2022-07-29_16-27-04-client-txt-L292-L298

  • FarmersDelight-1.18.2-1.1.2
  • Oh_The_Biomes_You'll_Go-forge-1.18.2-1.4.2
  • TerraBlender-forge-1.18.2-1.1.0.102
  • forge-1.18.2-40.1.68-universal
  • jei-1.18.2-9.7.1.232
commented

Hi there! Straw drops are controlled by Forge's Global Loot Modifiers. It's possible to add compatibility to other blocks by adding a few .json files into a datapack.

  1. Create a new file for your block under the farmersdelight namespace, specifying the odds of Straw dropping on harvest. Example:
    https://github.com/vectorwing/FarmersDelight/blob/1.18.2/src/main/resources/data/farmersdelight/loot_modifiers/straw_from_grass.json

  2. Add a global_loot_modifiers.json to the datapack under the forge namespace, to specify your files.
    https://github.com/vectorwing/FarmersDelight/tree/1.18.2/src/main/resources/data/forge/loot_modifiers

The reason this isn't attached to a tag is because Straw drops vary in their chances, and all blocks under a tag would have to use hardcoded conditions. That said, maybe I should write a Wiki page about this datapack feature...

commented

Ah, perfect! I was looking through the source code to see if it was in the code for the knife but to no avail. This should work for what I need!