PaperMC / PaperMC/Paper

Potential misleading Wandering Trader spawn chance configuration

Open
#13,137 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected behavior

When I set spawn-chance-min spawn-chance-max to 100, I expect the wandering trader to have a 100% chance to attempt a spawn every spawn-day-length period, assuming other conditions are met.

Observed/Actual behavior

The effective spawn chance is (configured_spawn_chance / 100) * 0.1. The maximum possible chance is only 10%.

In net.minecraft.world.entity.npc.WanderingTraderSpawner#spawn

Image
Steps/models to reproduce

Edit paper world config file, change spawning.wandering-trader.spawn-chance-min spawning.wandering-trader.spawn-chance-max to 100.

Start the server

Observe the spawn chance is much lower comparing to the config defined value.

Plugin and Datapack List

No plugins or datapacks

Paper version

Paper 1.21.9-47-master@21b4930

Other
Possible solution

Rename the spawn-chance to spawn-attempt-chance, or remove the hardcoded 10% chance when config is changed.

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

Start in net.minecraft.world.entity.npc.WanderingTraderSpawner#spawn and inspect how spawning.wandering-trader.spawn-chance-min and spawn-chance-max are applied. Reproduce the behavior with both values set to 100 on Paper 1.21.9-47, then determine whether the configured value should represent an attempt chance or be combined with the existing limit. Done means the configuration behavior matches its documented meaning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.