Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of hard max levels for enchantments #6661

Open
dktapps opened this issue Mar 23, 2025 · 1 comment
Open

Lack of hard max levels for enchantments #6661

dktapps opened this issue Mar 23, 2025 · 1 comment
Labels
Category: Core Related to internal functionality Status: Debugged Cause of the bug has been found, but not fixed Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Mar 23, 2025

Plugin information

Bug only happens with certain plugins (describe below)

Problem description

Enchantments such as Fire Aspect cause crashes somewhere above level 400 because the fire ticks will exceed the internal storeable NBT limits.

We currently don't enforce any limits on hard max level for enchantments. This was intended to allow plugins to give whatever levels of enchantment that they want irrespective of what's available through commands or enchanting tables. However, some hard limits need to be set to ensure that enchantments don't just randomly crash the server when used.

This is a parent issue for #4629.

Expected behaviour

It shouldn't be possible to give a Fire Aspect enchantment with level 1000, because this results in an indirect server crash which is difficult to debug: https://crash.pmmp.io/view/12162812

PocketMine-MP version

5.26.0

PHP version

N/A

Server OS

N/A

Game version (if applicable)

No response

@dktapps dktapps added Category: Core Related to internal functionality Status: Debugged Cause of the bug has been found, but not fixed Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Mar 23, 2025
@dktapps
Copy link
Member Author

dktapps commented Mar 23, 2025

If nothing else, enchantment levels need to be restricted to Limits::INT16_MAX, as that's the largest value that can be stored in enchantment NBT currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Status: Debugged Cause of the bug has been found, but not fixed Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant