Skip to content

Claude/farm zone management system m t hw3#29

Merged
Sharkblack3D merged 5 commits into
mainfrom
claude/farm-zone-management-system-mTHw3
Apr 29, 2026
Merged

Claude/farm zone management system m t hw3#29
Sharkblack3D merged 5 commits into
mainfrom
claude/farm-zone-management-system-mTHw3

Conversation

@Sharkblack3D
Copy link
Copy Markdown
Collaborator

No description provided.

claude added 5 commits April 21, 2026 17:14
Ravager, Pillager, Vindicator, Witch, Evoker and other Raider-type mobs
are automatically linked to Minecraft's raid mechanic when spawned. Without
an active raid and nearby players, the raid "fails" and the game removes
the mob — overriding setPersistent(true).

Fix: call raider.setCanJoinRaid(false) immediately after spawn while the
entity reference is still live. Detaching from raid logic makes the mob
behave like any other persistent mob: it stays alive indefinitely regardless
of player proximity or raid state.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
Add enforcePersistence() which runs alongside containment checks (every ~4s)
to ensure ALL tracked mobs still have persistent=true set. Some Minecraft
mechanics or other plugins may unset this flag; this ensures it's always
reapplied to prevent despawn.

Also set removeWhenFarAway(false) for all LivingEntity mobs. This disables
a separate removal mechanism that can override the persistent flag, ensuring
zero despawning regardless of player proximity.

This comprehensive approach guarantees that no farm zone mob will ever
despawn, addressing edge cases where the initial persistent flag or
forceloading alone were insufficient.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
When debug.mob=true, the scheduler heartbeat now displays the number of
online players. This helps diagnose whether the scheduler runs without
players and whether mobs spawn in offline scenarios.

Output: [MobSpawn] Scheduler alive — tick #N (players: M)

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
Extended checkContainment() to also teleport mobs back to their last safe
location when they enter water (WATER block, BUBBLE_COLUMN, or isInWater()).
This is checked alongside the region boundary check in the same cycle,
reusing the cached safe location with no additional findSafeLocation() cost.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
WorldGuard cancels EntityDamageByEntityEvent for non-members at NORMAL
priority. MobDamageListener runs at HIGH with ignoreCancelled=false and
re-allows the event when:
  - the damager is a Player
  - the damaged entity is tracked by MobSpawnManager (a zone mob)

This lets players without region membership farm the mobs without needing
WorldGuard bypass permissions. MobSpawnManager.isTracked(UUID) is exposed
as a public query method to support this check.

https://claude.ai/code/session_01QRahgKn43HbgkmDkQZCq9Z
@Sharkblack3D Sharkblack3D merged commit b62c979 into main Apr 29, 2026
2 checks passed
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