andrei1058 / andrei1058/BedWars1058
Game-Breaking InventoryClickEvent Error
- Ngôn ngữ chính
- Java
- Star
- 393
- Fork
- 286
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**Describe the bug**
When purchasing or upgrading any weapon/tool in the BedWars1058 shop, the item is not given and the console throws an error. This makes the gamemode unplayable since players cannot upgrade swords, axes, or pickaxes.
Error excerpt:
[16:31:00 ERROR]: Could not pass event InventoryClickEvent to BedWars1058 v25.5-SNAPSHOT
java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: generic.attackDamage
at org.bukkit.NamespacedKey.(NamespacedKey.java:87) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
at org.bukkit.NamespacedKey.minecraft(NamespacedKey.java:179) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
at bedwars-plugin-25.5-SNAPSHOT.jar/com.andrei1058.mc.bedwars.AbstractVerImplCmn1.getDamage(AbstractVerImplCmn1.java:212) ~[bedwars-plugin-25.5-SNAPSHOT.jar:?]
**To Reproduce**
Steps to reproduce the behavior:
1. Join a BedWars1058 v25.5-SNAPSHOT server running Paper 1.21+
2. Open the shop
3. Attempt to buy or upgrade any weapon/tool (e.g. sword, axe, pickaxe)
4. The resource is consumed but no item is given; console logs the error above
**Expected behavior**
Weapons/tools should be correctly purchased and added to the player’s inventory. No errors should appear in console.
**System (please complete the following information):**
- OS: Linux (Docker)
- Server software Paper
- Server Version 1.21
- Plugin Version v25.5-SNAPSHOT
**Additional context**
This appears to be a compatibility issue with Paper 1.20.5+ stricter attribute key validation.
Older BedWars1058 code uses `generic.attackDamage`, but since 1.20.5 the correct format is `minecraft:generic.attack_damage`.
The error is caused by `AbstractVerImplCmn1.getDamage()` calling:
```java
NamespacedKey.minecraft("generic.attackDamage"); According to the error log.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.