EssentialsX

EssentialsX

2M Downloads

/enchant defaulting to -1

BluePlastics opened this issue ยท 7 comments

commented

Information

Full output of /ess version:
15.11 17:03:57 [Server] INFO Server version: 1.13.2-R0.1-SNAPSHOT git-Paper-426 (MC: 1.13.2)
15.11 17:03:57 [Server] INFO EssentialsX version: dev-32.162
15.11 17:03:57 [Server] INFO LuckPerms version: 4.3.25
15.11 17:03:57 [Server] INFO Vault version: 1.6.7-b${env.TRAVIS_BUILD_NUMBER}
15.11 17:03:57 [Server] INFO EssentialsXSpawn version: dev-32.162
15.11 17:03:57 [Server] INFO EssentialsXChat version: dev-32.162

Server log: https://gist.github.com/BluePlastics/74edff27fa1a976d6b1e6febcc43c800

EssentialsX config: https://gist.github.com/BluePlastics/d34674af53192b3488451c32a1182ca0

Details

Description
All /enchant commands default to -1 instead of 1 (or 0)

Steps to reproduce
Enchant any item with the /enchant command using any enchantment (tested with vanishingcurse and alldamage)

Expected behavior
Enchant the item with 1 (or 0)

commented

Hmm, this is odd. I'll need to take a look at this at some point.

For now, could you test the latest experimental build and see if the issue is fixed?

commented

Latest build is throwing the following stacktrace:
https://hasteb.in/owemunuf.md

commented

This is now resolved, tested with alldamage, vanishingcurse, and bindingcurse all enchant at level 1 now.

commented

Thanks for submitting a bug report, and apologies for the delay in responding.

I'm not entirely sure why, but Essentials has always defaulted to -1 since the command was first added.

Defaulting to 0 would cause issues as 0 is interpreted to mean "remove this enchantment", but this doesn't answer the question of why 1 wasn't chosen.

(relevant code in 1.13 branch)

What effect does this cause when used on items?

commented

This causes the item to be enchanted with a -1 enchant:
(Not my screenshot) https://i.imgur.com/viywLbl.png

I noticed that it was -1 in the code but didn't really look at how long it was like that :.

commented

Is this the same effect as when using regular enchantments, rather than curses?

commented

Yes if I do all damage it defaults to -1 and behaves the same as the screenshot above (enchants the item with a -1 enchantment).