Skip to content

Fix #9381: deployer breaks all turtle eggs at once instead of one by one#10101

Open
TiagoCachadinha wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
TiagoCachadinha:fix/deployer-turtle-eggs
Open

Fix #9381: deployer breaks all turtle eggs at once instead of one by one#10101
TiagoCachadinha wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
TiagoCachadinha:fix/deployer-turtle-eggs

Conversation

@TiagoCachadinha
Copy link
Copy Markdown

@TiagoCachadinha TiagoCachadinha commented Mar 28, 2026

Fixes #9381

The deployer's tryHarvestBlock method removes a block in a way that bypasses playerDestroy, which is called when a player destroys a block normally. TurtleEggBlock overrides this method so that after it is destroyed, it places it back with EGGS decremented. Since tryHarvestBlock never calls playerDestroy, this logic is skipped and the whole cluster is destroyed at once.

The fix special-cases TurtleEggBlock to decrement EGGS manually and handle drops if the cluster has more than one egg.

DeployerTurtleEggsIssueSolved_compressed.mp4

A game test was added where a deployer with a silk touch tool and one without break different 4 turtle egg clusters. The one without silk touch must break them one by one, without harvesting any. The one with silk touch must break and harvest them one by one into its hopper.

…instead of one by one

The deployer's tryHarvestBlock method removes a block in a way that
bypasses playerDestroy, which is called when a player destroys a
block normally. TurtleEggBlock overrides this method so that after
it is destroyed, it places it back with EGGS decremented. Since
tryHarvestBlock never calls playerDestroy, this logic is skipped
and the whole cluster is destroyed at once.

The fix special-cases TurtleEggBlock to decrement EGGS manually and
handle drops if the cluster has more than one egg.

A game test was added where a deployer with a silk touch tool and
one without break different 4 turtle egg clusters. The one without
silk touch must break them one by one, without harvesting any. The
one with silk touch must break and harvest them one by one into its
hopper.
@TiagoCachadinha
Copy link
Copy Markdown
Author

Hey @VoidLeech, just letting you know I updated the PR description with a video showing the bug is fixed and the test i created, so that it is easier to review.

@VoidLeech VoidLeech added pr type: fix PR fixes a bug pr flag: simple PR has minimal changes labels Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr flag: simple PR has minimal changes pr type: fix PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deployer breaks entire turtle egg cluster at once instead of one egg at a time

2 participants