[SPIGOT-7350] Add method to EnchantItemEvent that returns the enchantment shown in the tooltip Created: 05/May/23 Updated: 25/Dec/24 Resolved: 12/Jun/23 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Almighty-Satan | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | EnchantTables, Event, enchantment |
Attachments: |
![]() |
Version: | CraftBukkit version 3744-Spigot-d1bd3bd-a7cfc77 (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
When a player hovers over an enchantment option in the enchantment table they will see a tooltip that shows one of the enchantments that will be applied (e.g. Sharpness I). This functionality was added in MC 1.8 but there is currently no way of knowing which enchantment was shown in the tooltip because EnchantItemEvent#getEnchantsToAdd returns an unordered map. Therefore I suggest adding a method EnchantItemEvent#getTooltipEnchant that returns the Enchantment shown in the tooltip. |