Skip to content

Use tool for loot to enable silk touch / fortune#725

Open
jshipley wants to merge 3 commits intoRearth:1.21from
jshipley:silk_axe
Open

Use tool for loot to enable silk touch / fortune#725
jshipley wants to merge 3 commits intoRearth:1.21from
jshipley:silk_axe

Conversation

@jshipley
Copy link
Copy Markdown
Contributor

Description

When using a chainsaw or prometheum axe to chop down an entire tree, the enchantments on the tool will now be respected when it comes to calculating loot drops.

How Has This Been Tested?

I have tested chopping down trees with enchanted and unenchanted chainsaws and prometheum axes on Fabric and NeoForge. I get leaves when the axe has Silk Touch as expected.

Checklist:

  • [ X ] My code uses the 'var' keyword where applicable.
  • [ X ] I have commented my code, particularly in hard-to-understand areas

There wasn't really any new code, I just replaced the <Level, BlockPos> Tuple with a record that also contains the axe ItemStack, and changed which version of Block.getDrops() gets called.

@Rearth Rearth self-requested a review March 31, 2026 20:13
@Rearth Rearth self-assigned this Mar 31, 2026
@Rearth
Copy link
Copy Markdown
Owner

Rearth commented Mar 31, 2026

Hi, thanks for the PR. I'm currently in the process of cleaning up some other stuff but will take a look at this real soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants