You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would work exactly like the ItemCraftedEvent, but for Smithing tables. Suppose I wanted to check for a condition where the Player has to make a Netherite Pickaxe to enter a certain dimension. I could do that if the item was Crafted by regular crafting means, however, if I go to do it with the Smithing Table, it doesn't contribute to the ItemCraftedEvent. I feel like adding this Event would make modders lives a lot easier. Examples of the event in action would be:
public class CraftTracker {
@SubscribeEvent
public static void onSmithing(PlayerEvent.ItemSmithingEvent event) {
if (event.getEntity() != null && event.getEntity() instanceof Player) {
execute(event, event.getEntity(), event.getSmithing);
}
}
public static void execute(Player player, ItemStack craftedItem) {
execute(null, player, craftedItem);
}
private static void execute(@Nullable Event event, Player player, ItemStack craftedItem) {
if (player == null || craftedItem == null) {
System.out.println("CraftTracker: Player or crafted item is null.");
return;
}
System.out.println(craftedItem + "has been forged")
}
}
The text was updated successfully, but these errors were encountered:
It would work exactly like the ItemCraftedEvent, but for Smithing tables. Suppose I wanted to check for a condition where the Player has to make a Netherite Pickaxe to enter a certain dimension. I could do that if the item was Crafted by regular crafting means, however, if I go to do it with the Smithing Table, it doesn't contribute to the ItemCraftedEvent. I feel like adding this Event would make modders lives a lot easier. Examples of the event in action would be:
The text was updated successfully, but these errors were encountered: