Skip to content

[v2.3.3] Restrict zombie block-break target range - #17

Open
KiyroPrower wants to merge 1 commit into
NguyenDevs:mainfrom
KiyroPrower:fix/zombie-target-range
Open

KiyroPrower wants to merge 1 commit into
NguyenDevs:mainfrom
KiyroPrower:fix/zombie-target-range

Conversation

@KiyroPrower

Copy link
Copy Markdown

Summary

Fixes Zombie Break Block assigning and retaining player targets for every Bukkit zombie variant at distances up to the configured 150 blocks. The custom target search now applies only to standard zombies that can actually use the block-breaking mechanic.

Detailed Changes

  • Restricts custom target acquisition to EntityType.ZOMBIE.
  • Requires an axe, pickaxe, or shovel in the zombie's main hand before target persistence is enabled.
  • Excludes husks, drowned, zombie villagers, zombified piglins, and unequipped zombies from the extended search.
  • Removes persisted target state when the feature is disabled or a zombie becomes ineligible.
  • Skips target searches in worlds where Zombie Break Block is disabled.
  • Moves Bukkit entity inspection from asynchronous scheduler callbacks to the primary server thread.
  • Bumps the plugin version from 2.3.2 to 2.3.3.
  • Adds CHANGELOG.md and README_STATE_SNAPSHOT.md.

Technical Notes

Paper's Zombie interface has Drowned, Husk, PigZombie, and ZombieVillager as known subinterfaces. The previous getEntitiesByClass(Zombie.class) scan and instanceof Zombie event handling therefore included all of these variants. The new eligibility guard uses the exact Bukkit entity type plus the supported-tool requirement at every target-management entry point.

The existing max-target-distance option remains unchanged and continues to control eligible block-breaking zombies. Block selection, block lists, block drops, ProtocolLib animations, and claim checks are unchanged.

Verification

  • Ran gradlew.bat clean build --no-daemon: successful.
  • Ran git diff --check: successful.
  • Confirmed generated artifact: build/libs/SuddenDeath-2.3.3.jar (460271 bytes).
  • Inspected the JAR's embedded plugin.yml: version 2.3.3, API 1.21.
  • Reviewed Paper 1.21 Javadocs for the Bukkit Zombie inheritance hierarchy.
  • No live Paper server playtest was performed in this environment.

Compatibility

  • Minecraft/Paper API: 1.21, unchanged.
  • Java release target: 21, unchanged.
  • Build host used for verification: Temurin JDK 25 with Gradle compiling for Java 21.
  • ProtocolLib remains a required dependency.
  • No dependencies were added, removed, or updated.
  • Existing configuration files remain compatible.

Risks and Limitations

  • Runtime target acquisition still needs an in-server regression test with zombie, husk, drowned, zombie villager, and zombified piglin entities.
  • Standard zombies without a supported tool no longer receive the extended target distance. This is intentional because they cannot use Zombie Break Block.
  • Servers upgrading from 2.3.2 should restart to clear transient targets assigned by the previous plugin instance.
  • Existing Gradle and Java deprecation warnings remain outside this fix's scope.

Files or Systems Affected

  • ZombieBreakBlockFeature: eligibility, target search, target persistence, scheduler context.
  • build.gradle: patch version.
  • plugin.yml: patch version.
  • CHANGELOG.md: 2.3.3 release notes.
  • README_STATE_SNAPSHOT.md: project checkpoint and continuation notes.

Public API, Configuration, and Dependency Impact

  • Public API changes: none.
  • Configuration changes: none; max-target-distance keeps its current key and default.
  • Breaking changes: none to configuration or APIs. Behavior is narrowed to the feature's documented eligible zombies.
  • Dependencies: no changes.

Changelog

Fixed

  • Restricted Zombie Break Block's extended target search to standard zombies holding supported tools.
  • Prevented zombie variants and unequipped zombies from retaining distant player targets.
  • Disabled target persistence in worlds where Zombie Break Block is disabled.

Changed

  • Moved Zombie Break Block entity inspection to the primary server thread.

README Snapshot Confirmation

README_STATE_SNAPSHOT.md was created and records the current version, architecture, implemented systems, known limitations, build result, and recommended live-test steps.

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.

1 participant