Claude/farm zone management system m t hw3#29
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.