[SPIGOT-7416] SmithItemEvent not firing in Smithing Table Created: 30/Jun/23  Updated: 25/Dec/24  Resolved: 30/Jun/23

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Simon Schütt Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.20, EventHandler, SmithItemEvent
Environment:

OS: macOS 13.4.1 Ventura and Linux

openjdk 17.0.4.1 2022-08-12 LTS

OpenJDK Runtime Environment Zulu17.36+17-CA (build 17.0.4.1+1-LTS)

OpenJDK 64-Bit Server VM Zulu17.36+17-CA (build 17.0.4.1+1-LTS, mixed mode, sharing)


Attachments: PNG File Screenshot 58.png     File SmithItem-1.0-SNAPSHOT.jar    
Version:  This server is running CraftBukkit version 3815-Spigot-64b565e-9f64f0d (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

When listening to a SmithItemEvent in Spigot, nothing happens, the code in the event handler does not run:

public class SmithItemListener implements Listener {

Plugin plugin;

public SmithItemListener(Plugin plugin) {
    this.plugin = plugin;
    plugin.getServer().getPluginManager().registerEvents(this, plugin);
}

/**
* Does not get fired.
* @param e
*/
@EventHandler
public void onSmith(SmithItemEvent e) {
    plugin.getLogger().info("Smith");
}

/**
* Works as normal, proves that this class is in fact a registered Listener.
* @param e
*/
@EventHandler
public void onPrepareSmith(PrepareSmithingEvent e) {
    plugin.getLogger().info("Prepare");
}

}

In this case "Prepare" would be outputted to the console like normal, but when taking the finished item out of the result slot, "Smith" is not logged to console.

Steps to reproduce:

  1. Use sample plugin or create basic SmithItemEvent Listener.
  2. Open a Smithing Table in Minecraft.
  3. Craft a Netherite Sword like in the appended screenshot and take it out of the result slot.
  4. Look in the console, whether "Smith" (from the example code in the SmithEvent Listener) is logged.

 

The sample plugin is attached as well as the crafting ingredients/step in the Smithing Table.

I should note that this worked like expected in Spigot 1.19, probably has something to do with the updated Smithing Table behavior in 1.20.

Console Output with test/sample plugin:

[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:21] [Server thread/INFO]: [SmithItem] Prepare[16:14:22] [Server thread/INFO]: [SmithItem] Prepare[16:14:22] [Server thread/INFO]: [SmithItem] Prepare[16:14:22] [Server thread/INFO]: [SmithItem] Prepare[16:14:23] [Server thread/INFO]: [SmithItem] Prepare[16:14:23] [Server thread/INFO]: [SmithItem] Prepare[16:14:23] [Server thread/INFO]: [SmithItem] Prepare

 

 


Generated at Sat Dec 13 15:18:36 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.