[SPIGOT-7953] UseCooldownComponent - Crash client or delete item Created: 11/Nov/24 Updated: 25/Dec/24 Resolved: 12/Nov/24 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Ssomar | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Version: | This server is running CraftBukkit version 4378-Spigot-e65d67a-8ef9079 (MC: 1.21.3) |
| Guidelines Read: | Yes |
| Description |
|
Hello ! When I try to only modify the cooldonwGroup of UseCooldownComponent. In survival : The item is deleted after a quit/join. In creative : the client return an error and the item is deleted. Short video of the test attached. It seems not appearing when I initialize the cooldownSeconds setting with a value superior to 0 The code to reproduce the issue: public class TESTEVENT implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onPlayerToggleSneakEvent(PlayerToggleSneakEvent e) { if(!e.isSneaking()) return; Player p = e.getPlayer(); ItemStack item = new ItemStack(Material.BEACON); ItemMeta meta = item.getItemMeta(); UseCooldownComponent useCooldownComponent = meta.getUseCooldown(); useCooldownComponent.setCooldownGroup(NamespacedKey.fromString("its_a_test")); // REQUIRED TO NOT HAVE THE ISSUE useCooldownComponent.setCooldownSeconds(1); meta.setUseCooldown(useCooldownComponent); item.setItemMeta(meta); p.getInventory().addItem(item); } } |