Skip to content

Allow enabling/disabling item drops based on tool type#2886

Merged
IntegratedQuantum merged 10 commits intoPixelGuys:masterfrom
DellieDelta:require-forbid-item-drops
Apr 19, 2026
Merged

Allow enabling/disabling item drops based on tool type#2886
IntegratedQuantum merged 10 commits intoPixelGuys:masterfrom
DellieDelta:require-forbid-item-drops

Conversation

@DellieDelta
Copy link
Copy Markdown
Contributor

@DellieDelta DellieDelta commented Apr 11, 2026

Hiiii, love this project! :D

Resolves #856

Opens up #1558, #2384 and #2787

Adds two new optional tags to item drops:

  • .forbiddenToolTags: Using a tool with any of these tags won't drop the item
  • .allowedToolTags: The item is only dropped when using a tool with any of these tag

Forbidden has preference over allowed

The only disadvantage I could think of with this approach is that you can't match the hand, or the combination hand + a tool, because the hand is treated as "no tool", it doesn't have a tag. But I couldn't think of any use cases for that anyway, so it might be fine!

I've changed leaves for easy testing (apples only drop by hand, and leaves only drop by sickle). I'll change it back when the approach is greenlit :3
Removed the testing config

@Wunka Wunka moved this to Low Priority in PRs to review Apr 12, 2026
@Wunka
Copy link
Copy Markdown
Contributor

Wunka commented Apr 12, 2026

You can only specify one tag for both, my reasoning is that when you want to specify multiple tools, like for collecting leaves, you can create a tag like leafCutter and give it to the tools you want to include. Shifting the flexibility to the tool tags themselves

Welcome to Cubyz!
I see your reasoning, but I want to come from a different direction.
What If I am an addon creator and add a a block that drops x when broken by a pickaxe or an axe.
It would create unnecessary conflicts with other addons, if I had to add a new tag to the pickaxe and axe.

And with adding the possibility to specify multiple tags we still allow for the possibility to add such grouping tags as you mentioned

@DellieDelta
Copy link
Copy Markdown
Contributor Author

Good point! I'll change it :)

Comment thread src/sync.zig Outdated
Copy link
Copy Markdown
Contributor

@Wunka Wunka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you need to wait for quantum to review.

@DellieDelta
Copy link
Copy Markdown
Contributor Author

DellieDelta commented Apr 13, 2026

Thankss, more for the pile 😈

Comment thread src/blocks.zig Outdated
Comment thread src/blocks.zig Outdated
Comment thread src/items.zig Outdated
@IntegratedQuantum IntegratedQuantum moved this from Low Priority to In review in PRs to review Apr 18, 2026
@DellieDelta
Copy link
Copy Markdown
Contributor Author

Hiii Quantum, thanks for the review! I've fixed the points :)

Comment thread src/blocks.zig Outdated
Comment thread src/blocks.zig
Comment thread src/items.zig Outdated
Comment thread src/blocks.zig Outdated
Comment thread src/blocks.zig
Comment thread src/blocks.zig Outdated
Comment thread src/blocks.zig Outdated
Copy link
Copy Markdown
Member

@IntegratedQuantum IntegratedQuantum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, please next up actually add it to the plants so we can finally get rid of all the undesired inventory clutter

@IntegratedQuantum IntegratedQuantum merged commit 75c2301 into PixelGuys:master Apr 19, 2026
1 check passed
@DellieDelta
Copy link
Copy Markdown
Contributor Author

Thankss Quantum! I'll make a new PR :)

@DellieDelta DellieDelta deleted the require-forbid-item-drops branch April 19, 2026 19:37
codemob-dev pushed a commit to codemob-dev/Cubyz that referenced this pull request Apr 20, 2026
Hiiii, love this project! :D

Resolves PixelGuys#856

Opens up PixelGuys#1558, PixelGuys#2384 and PixelGuys#2787

Adds two new optional tags to item drops:
- `.forbiddenToolTags`: Using a tool with any of these tags won't drop
the item
- `.allowedToolTags`: The item is only dropped when using a tool with
any of these tag

Forbidden has preference over allowed

The only disadvantage I could think of with this approach is that you
can't match the hand, or the combination hand + a tool, because the hand
is treated as "no tool", it doesn't have a tag. But I couldn't think of
any use cases for that anyway, so it might be fine!

~~I've changed leaves for easy testing (apples only drop by hand, and
leaves only drop by sickle). I'll change it back when the approach is
greenlit :3~~
Removed the testing config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Allow enabling/disabling item drops based on tool type

3 participants