PaperMC / PaperMC/Paper

Mob Switch - Mobs not prohibiting spawning of other mobs

Open
#8,467 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs testing type: bug
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Mob switches are a construct that allows players to conditionally limit the natural spawning of new types of mobs in the world. When activated, the mob switch prevents new mobs from spawning. When deactivated, normal mob spawning occurs. The mechanisms are well documented in the community, but the basic mechanics are to create a large number of mobs of the needed type in a single chunk, manipulate them so that they will not despawn, and then to force that chunk to stay loaded while you wish mob spawning disabled.

There are several types of mob switches I built and tested on PaperMC that did not behave as expected:

  1. Silverfish Spawner Mob Switch
  2. Warden Mob Switch
  3. Zombie Villager Mob Switch
  4. Shulker Mob Switch

The expected behavior for any of these mob switches, is that assuming a single player is on the server, and 70+ mobs are spawned by the mob switch and those chunks remain loaded via chunk loader then no other mobs should spawn via natural spawning rules.

Observed/Actual behavior

Each of the mob switches built did not prohibit the spawning of other mobs while active. The expected behavior with a mob switch running would be that no other mobs should spawn in the world as per normal conditions however mobs continued to spawn. Even with WELL over 70 mobs spawned in the mob switch.

I will also add that in my testing world the paper jar was swapped for spigot, and the mob switches immediately worked in suppressing mob spawning. Switching the server jar back/forth would show working/not working behaviors

Steps/models to reproduce

Build any of the desired mob switches:

  1. Silver fish spawner - https://www.youtube.com/watch?v=EDBesTQW9XM

  2. Warden - https://www.youtube.com/watch?v=8ty3HE3Vg8U

  3. Zombie Villager - 70+ villagers that you have traded with, then zombified

  4. Shulker mob switch - did not buid/test as I didnt want to build with spawn eggs in case spawn tagging for those mobs is done differently by paper

  5. Keep the area loaded via chunk loader such that the mob switch chunk is a lazy chunk - https://www.youtube.com/watch?v=dJdEo2QKmzA

Plugin and Datapack List

AntiPopup/
bStats/
Chunky/
CoreProtect/
CustomTab/
DecentHolograms/
DiscordSRV/
dynmap/
Essentials/
GriefDefender/
GriefPreventionData/
Harbor/
InventoryRollbackPlus/
JoinCommands/
LastLoginAPI/
LuckPerms/
OpenInv/
OreAnnouncer/
Orebfuscator/
PlaceholderAPI/
Plan/
PlayerHeads/
PluginMetrics/
ProtocolLib/
Shopkeepers/
spark/
SuperVanish/
Tablist/

Paper version

This server is running Paper version git-Paper-210 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 0bdf997)
You are running the latest version
Previous version: git-Paper-201 (MC: 1.19.2)

Other

Configs:

Paper-global.yml: https://pastebin.com/G7tHnjee
Paper-world-default.yml: https://pastebin.com/fKyz3N2C

Was suggested to submit report: https://discord.com/channels/289587909051416579/289587909051416579/1029444287231963297

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported mob-switch setups on Paper 1.19.2, keeping the relevant chunk loaded as a lazy chunk, and compare the result with Spigot. Verify whether 70+ mobs of the relevant type prevent natural spawning; done means the active switch consistently suppresses other natural mob spawns.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.