Yet that's not that much helpfull in my case as I want to create a generic wrapper which basicaly replaces the in game crafting. You might ask why I'd like to do that, to me the instantaneous crafting just doesn't feel right so I tried to create a short delay by aborting the original craft, start a timer, fill a progress bar and once a certain time has passed add the craft result to the player inventory ;-).
You could grab the item from the PlayerCraftItemEvent and check what item it is, similar to how james1bow suggested above, e.g. like this:
public void onPlayerCraftItem(PlayerCraftItemEvent evt) {
Item item = evt.getItem();
//Check if item is a construction element
if (item instanceof Item.ConstructionItem construction) {
System.out.println("Player crafted construction element: " + construction.getConstructionName()); //prints "block", for example
//Check if item is an object
else if (item instanceof Item.ObjectItem object) {
System.out.println("Player crafted object: " + object.getObjectName()); //prints "workbench", for example
//Check if item is a garment
else if (item instanceof Item.ClothingItem clothing) {
System.out.println("Player crafted clothing item: " + clothing.getClothingName()); //prints "mininghelmet", for example
//Check if item is a blueprint
else if (item instanceof Item.BlueprintItem blueprint) {
System.out.println("Player crafted blueprint: " + blueprint.getBlueprintName()); //prints "My summer house", for example
//Else it's a regular item
System.out.println("Player crafted regular item: " + item.getName()); //prints "pickaxe", for example
Display More
first, there's no object definition for a primitive workbench but a item definition so using this as criteria to choose between addItem and addObjectItem doesn't work.
Primitive workbenches are objects, so they're represented by an ObjectDefinition. However, crafting recipes never store object definitions, they only store item definitions. In case of the workbench, the item definition references the generic "objectkit" item - this is how most objects are represented in inventory. Similar to the generic "constructionitem", which represents almost all construction elements, or the generic "clothingitem", which represented all types of clothes.
But getting the correct item from a Recipe is indeed a bit tricky... internally the game stores some meta data (to determine the type of item) which is unfortunately not accessible by the API... what you could do is to check the RecipeType: If it's RecipeType.Object, you can use the recipe name to get an ObjectDefinition. If it's RecipeType.Clothing, use the recipe name to get a ClothingDefinition. If it's RecipeType.Block or RecipeType.Construction, you can get a ConstructionDefinition from the name. Else it's a regular item (where you can use the name to get an ItemDefinition).
But if you're still inside the PlayerCraftItemEvent, it's still better to check the actual item instance (as mentioned above) 
Having said that, I think it would be useful if we add a new addItem() method which just takes a String. There you could just provide the target item/object name and the game would automatically determine the type of item it has to add (this would work for items, but also for objects, clothes, construction elements etc) 
on the way I discovered a further issue, how to add a blueprint item to the inventory?
... well without the other issue solved that'd be just a question for curiosity 
Unfortunately there is no method to add a blueprint to the inventory yet (because there was little use for such a method yet, since a client could only use his local blueprints anyway). But I can put this on our to do list 
does tell true for both a workbench as well as for lumber.
Hmm... that's not supposed to happen
The condition if (item instanceof Item.ObjectItem object) should only be true for the workbench in this case, not for lumber. Are you sure it's true for lumber? Unfortunately I wasn't able to reproduce this on my end
If you use the code above for the PlayerCraftItemEvent, the output for lumber should be "Player crafted regular item: lumber"