Skip to content

Add per-projectile uncertainty configuration to paper-global.yml - #14006

Open
LoliColleen wants to merge 1 commit into
PaperMC:mainfrom
LoliColleen:add-projectile-uncertainty-config
Open

Add per-projectile uncertainty configuration to paper-global.yml#14006
LoliColleen wants to merge 1 commit into
PaperMC:mainfrom
LoliColleen:add-projectile-uncertainty-config

Conversation

@LoliColleen

Copy link
Copy Markdown

Summary

Adds a projectiles.uncertainty section to paper-global.yml that allows server owners to override the uncertainty parameter passed to Projectile#shoot on a per-entity-type basis.

  • Introduces ProjectileUncertainty.resolve(EntityType, float) to look up configured values from GlobalConfiguration
  • Configuration keys are Minecraft entity type ids (e.g. minecraft:arrow, minecraft:snowball)
  • Unconfigured types keep vanilla behavior; setting a value to 0 removes random spread for that projectile type
  • Per-entry default preserves the vanilla uncertainty for that call site

Configuration is applied at the call sites where uncertainty is originally passed (bow/crossbow shootProjectile, throwable items, mob ranged attacks, dispensers, and Bukkit API launch paths), not inside Projectile#shoot or the shared spawn helpers.

Configuration example

projectiles:
  uncertainty:
    minecraft:arrow: 0
    minecraft:snowball: 0
    minecraft:trident: default

@LoliColleen
LoliColleen requested a review from a team as a code owner June 29, 2026 10:51
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jun 29, 2026

@Warriorrrr Warriorrrr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better diff-wise and usefulness-wise to instead have an event for modifying the uncertainty, instead of throwing it into the config

@LoliColleen

Copy link
Copy Markdown
Author

It would be better diff-wise and usefulness-wise to instead have an event for modifying the uncertainty, instead of throwing it into the config

Actually, I joined this just to conveniently set uncertainty to zero. There are already many events related to projectiles, and I'm not sure how to name and implement such a new event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants