Skip to content

Conversation

@Krakenied
Copy link
Collaborator

Introduces Projectile2ItemCache to reliably associate fired projectiles with the item used to shoot them. This replaces the previous temporary workaround that was vulnerable to player exploits, ensuring accurate item tracking during damage events.

@Krakenied Krakenied force-pushed the fix/proper-bow-enchants-tracking branch 2 times, most recently from 143b9c2 to 184ce28 Compare December 16, 2025 18:44
Introduces Projectile2ItemCache to reliably associate fired
projectiles with the item used to shoot them. This replaces
the previous temporary workaround that was vulnerable to player
exploits, ensuring accurate item tracking during damage events.
@Krakenied Krakenied force-pushed the fix/proper-bow-enchants-tracking branch from 184ce28 to 8368456 Compare December 18, 2025 13:51
final Projectile projectile = event.getProjectile();
final ItemStack item = event.getItemStack();

Projectile2ItemCache.this.backingMap.put(projectile, item);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, doesn't really work for tridents - event is called, however the projectile reference from damage event differs.

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.

1 participant